Skip to content

Search topics & cppreference

Search all study topics, concept maps, and 6,587 C++ and C reference pages.

std::atomic_flag::notify_one

Performs atomic notifying operations.

atomic
  • C++20
  • C++26
1 min readView on cppreference
NotebookLM
void notify_one() noexcept;
(1) (since C++20)
(constexpr since C++26)
void notify_one() volatile noexcept;
(2) (since C++20)

Performs atomic notifying operations.

If there is a thread blocked in atomic waiting operation (i.e. wait()) on *this, then unblocks at least one such thread; otherwise does nothing.

Notes

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

Example

This section is incomplete
Reason: no example

See also

(C++20)
blocks the thread until notified and the atomic value changes
(public member function)
blocks the thread until notified and the flag changes
(function)
notifies a thread blocked in atomic_flag_wait
(function)

Content from this page on cppreference.com, licensed under CC-BY-SA 3.0 and GFDL. Modified: restyled, site navigation removed, code windows added. Offline snapshot of 9 February 2025.