std::counti...g_semaphore(3)
okay bestie, welcome to the C++ Standard Libary manual page for std::counti...g_semaphore(3) β aka the std::counting_semaphore destructor page. Itβs giving tiny page, huge βdo not touch me while Iβm destructingβ energy. π¦β¨
π NAME π
std::counting_semaphore::~counting_semaphoreβ the destructor, and the description is literallystd::counting_semaphore::~counting_semaphoretoo. Repetition is the brand. π
π¦ Synopsis π¦
~counting_semaphore(); (since C++20)
This destructor destroys the counting_semaphore object. Periodt. π
β οΈ UB ALERT, bestie: the behavior is undefined if any thread is concurrently calling any other member function on this semaphore. This includes threads blocked inacquire(),try_acquire_for(), ortry_acquire_until(). So likeβ¦ do not have another thread in there doing member-function things while this destructor is running. Thatβs the whole warning. ππ
okay thatβs the page, bestie. π«Ά It came from http://cppreference.com and is dated 2024.06.10. slay and destruct safely. π
β¨
π¦ 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