std::atomic_flag::test_and_set
Min standard notice:
Header: <atomic>
Atomically changes the state of a std::atomic_flag to set (true) and returns the value it held before.
# Declarations
bool test_and_set( std::memory_order order =
std::memory_order_seq_cst ) volatile noexcept;
(since C++11)
bool test_and_set( std::memory_order order =
std::memory_order_seq_cst ) noexcept;
(since C++11)
# Parameters
order: the memory synchronization order