atomic
指的是原子操作, 一个一个来, 谁也别抢, 急也没用. 只要用于对内存数据的原子保护.
Atomic types are types that encapsulate a value whose access is guaranteed to not cause data races and can be used to synchronize memory accesses among different threads.
This header declares two C++ classes, atomic and atomic_flag, that implement all the features of atomic types in self-contained classes. The header also declares an entire set of C-style types and functions compatible with the atomic support in C.
// atomic::operator=/operator T example:
#include <iostream> // std::cout