February 2019
Intermediate to advanced
592 pages
20h 37m
English
An instance of std::atomic_flag may be initialized using the ATOMIC_FLAG_INIT macro, in which case it’s initialized into the clear state. For objects of static storage duration, initialization shall be static initialization.
#define ATOMIC_FLAG_INIT unspecified
std::atomic_flag flag=ATOMIC_FLAG_INIT;
Atomically sets the flag and checks whether or not it was set.
bool test_and_set(memory_order order = memory_order_seq_cst) volatile noexcept; bool test_and_set(memory_order order = memory_order_seq_cst) noexcept; ...