std::atomic_flag::test_and_set

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

# See also