atomic_flag::test_and_set Method

Sets the bool flag that is stored in *this to true, within the specified memory_order constraints.

bool atomic_flag::test_and_set(
   memory_order Order = memory_order_seq_cst
) volatile _NOEXCEPT;
bool atomic_flag::test_and_set(
   memory_order Order = memory_order_seq_cst
) _NOEXCEPT;

Parameters

Return Value

The initial value of the flag that is stored in *this.

Requirements

Header: atomic

Namespace: std

See Also

Reference

atomic_flag Structure

<atomic>

atomic_flag_test_and_set_explicit Function