Atomically set the flag and check whether or not it was set.
bool test_and_set( memory_order order = memory_order_seq_cst) volatile;
- Effects:
Atomically sets the flag.
- Returns:
trueif the flag was set at the point of the call,falseif the flag was clear.- Throws:
Nothing.
- Note:
This is an atomic read-modify-write operation for the memory location comprising
*this.
Header
#include <atomic>