std::atomic...g_notify_one(3)
okay so bestie, welcome to the C++ Standard Libary manual β today's main character is std::atomic...g_notify_one(3), and her whole thing is waking up at least one thread, not the entire group chat. π
β¨
πΈ NAME πΈ
std::atomic_flag_notify_oneβstd::atomic_flag_notify_one. yes, the name section is lowkey just the name twice; she ate and left no crumbs. π
π Synopsis π
Defined in header <atomic>
void atomic_flag_notify_one( std::atomic_flag* object ) noexcept;
(1) (since C++20)
void atomic_flag_notify_one( volatile std::atomic_flag* object )
(2) (since C++20)
noexcept;
Performs atomic notifying operations. big notify energy. π
If there is a thread blocked in an atomic waiting operation (i.e. std::atomic_flag_wait(), std::atomic_flag_wait_explicit(), or std::atomic_flag::wait()) on *object, then unblocks at least one such thread; otherwise does nothing.
Equivalent to object->notify_one().
π Parameters π
objectβ pointer to theatomic_flagobject to notify. that's the bestie getting poked awake. π
π Return value π
(none)β literally no return value. she gives nothing and serves everything. π
π§ Notes π§
This form of change-detection is often more efficient than simple polling or pure spinlocks. no cap, that's the note. β‘
π Example π
This section is incomplete Reason: no example
π not the example section being empty. we still love her.
π See also π
notify_oneβ notifies at least one thread waiting on the atomic object.(C++20)(public member function of std::atomic_flag)notify_allβ notifies all threads blocked waiting on the atomic object.(C++20)(public member function of std::atomic_flag)atomic_flag_notify_allβ notifies all threads blocked inatomic_flag_wait.(C++20)(function)
ποΈ Category: ποΈ
Todo no example
mwah π β source/version: http://cppreference.com, date: 2024.06.10, page: std::atomic...g_notify_one(3). byeee π«Άβ¨
π¦ 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