std::condit...on_variable(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

okay so bestie, welcome to the std::condit...on_variable(3) page from the C++ Standard Libary β€” yes, that's the manual name, typo and all, we keep the facts exact around here πŸ’…

πŸŽ€ NAME πŸŽ€

  • std::condition_variable::~condition_variable β€” std::condition_variable::~condition_variable. that's the whole name, no cap 🫢

✨ Synopsis ✨

~condition_variable();  (since C++11)

wait, since C++11? iconic. this destructor has been doing its thing since then, periodt ✨

okay so this destructor destroys the object of type std::condition_variable. that's the whole job, and it ate πŸ’…

🚨 it is only safe to invoke the destructor if all threads have been notified. that's the vibe check. but ngl, 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. no extra requirement, fr fr.

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 main-character responsibility, bestie πŸ‘‘ don't skip it.

πŸ¦‹ See also πŸ¦‹

  • C documentation for cnd_destroy β€” the C-side bestie, iykyk 🫢

that's the whole page, bestie: source is http://cppreference.com, dated 2024.06.10, and it's giving std::condit...on_variable(3) energy. mwah πŸ’‹

πŸ“¦ where this page comes from