std::atomic_flag::wait

Performs atomic waiting operations. Behaves as if it repeatedly performs the following steps:

# Declarations

void wait( bool old, std::memory_order order =
std::memory_order_seq_cst ) const noexcept;

(since C++20) (constexpr since C++26)

void wait( bool old,
std::memory_order order =
std::memory_order_seq_cst ) const volatile noexcept;

(since C++20)

# Parameters

# Notes

This form of change-detection is often more efficient than simple polling or pure spinlocks.

Due to the ABA problem, transient changes from old to another value and back to old might be missed, and not unblock.

# Example

This section is incompleteReason: no example

# See also