std::counti...g_semaphore(3)

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

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 literally std::counting_semaphore::~counting_semaphore too. 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 in acquire(), try_acquire_for(), or try_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