1、使用 C++11中的原子操作(atomic operation)
#include <atomic>
std::atomic_int myInt;
2、使用InterlockedExchangeAdd(LONG volatile *Addend,LONG Value)
#include <winnt.h>
1、使用 C++11中的原子操作(atomic operation)
#include <atomic>
std::atomic_int myInt;
2、使用InterlockedExchangeAdd(LONG volatile *Addend,LONG Value)
#include <winnt.h>