std::atomic_flag_wait, std::atomic_flag_wait_explicit

Header: <atomic>

Performs atomic waiting operations.

# Declarations

void atomic_flag_wait( const atomic_flag* object, bool old ) noexcept;

(since C++20)

void atomic_flag_wait( const volatile atomic_flag* object,
bool old ) noexcept;

(since C++20)

void atomic_flag_wait_explicit( const atomic_flag* object,
bool old, std::memory_order order ) noexcept;

(since C++20)

void atomic_flag_wait_explicit( const volatile atomic_flag* object,
bool old, std::memory_order order ) noexcept;

(since C++20)

# Parameters

# Return value

(none)

# 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