std::atomic...::notify_one(3)
okay bestie, welcome to the std::atomic...::notify_one(3) page from the C++ Standard Libary manual set π (yes, that spelling is the manual name β we're keeping it iconic and untouched). This one is all about std::atomic_ref::notify_one, and it's lowkey the βwake up at least one waiting bestieβ button of the atomic world β¨
π NAME π
std::atomic_ref::notify_oneβstd::atomic_ref::notify_one
π¦ Synopsis π¦
void notify_one() const noexcept; (1) (since C++20)
void notify_one() const volatile noexcept; (2) (since C++20)
Both overloads are since C++20 π. Overload (1) is const noexcept; overload (2) is const volatile noexcept β matching the code block exactly, no edits, periodt π
.
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.
π Return value π
(none)β no return value, bestie. It does the notifying thing and vibes π«Ά
β¨ Notes β¨
This form of change-detection is often more efficient than simple polling or pure spinlocks. So if you were about to spin, the note is gently saying this change-detection form is often more efficient β that's the whole claim, no extra lore π¦
πΈ Example πΈ
This section is incomplete. Reason: no example.
π¦ See also π¦
waitβ blocks the thread until notified and the atomic value changes (public member function)atomic_waitβ(C++20)atomic_wait_explicitβ blocks the thread until notified and the atomic value changes(C++20)(function template)atomic_notify_oneβ notifies a thread blocked inatomic_wait(C++20)(function template)
π·οΈ Category π·οΈ
* Todo no example
That's the page, bestie π
It came from http://cppreference.com with the 2024.06.10 date/version stamp, and the footer tag was std::atomic...::notify_one(3) β mwah, go notify at least one waiting thread and slay ππ₯
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms