Atomically set the flag and check whether or not it was set.
bool test_and_set( memory_order order = memory_order_seq_cst) volatile;
Atomically sets the flag.
true if the flag was
set at the point of the call,
if the flag was clear.
This is an atomic read-modify-write operation for the memory location