std::condit...ariable_any(3)
π NAME π
std::condition_variable_any::~condition_variable_any β the destructor for std::condition_variable_any, aka the goodbye function. This page is std::condit...ariable_any(3) from the C++ Standard Libary manual, and yes bestie the full name is also literally std::condition_variable_any::~condition_variable_any π
π Synopsis π
~condition_variable_any(); (since C++11)
Destroys the object of type std::condition_variable_any. That's the whole mission, no cap. π
Safety check, bestie: it is only safe to invoke the destructor if all threads have been notified. π¨
It is not required that they have exited their respective wait functions: some threads may still be waiting to reacquire the associated lock, or may be waiting to be scheduled to run after reacquiring it. So like, notified does not automatically mean fully packed up and out the door. π¦
The programmer must ensure that no threads attempt to wait on *this once the destructor has been started, especially when the waiting threads are calling the wait functions in a loop or are using the overloads of the wait functions that take a predicate. This is the part where you do not play games with the lifecycle, fr fr. π
π¦ See also π¦
C documentation for cnd_destroy β that's the C-side cousin, go say hi π«Ά
mwah π this page came from http://cppreference.com, version/date 2024.06.10, and the header stamped std::condit...ariable_any(3) β okay bye bestie, go destroy responsibly β¨π
π¦ 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