std::counting_semaphore<LeastMaxValue>::~counting_semaphore
来自cppreference.com
< cpp | thread | counting semaphore
~counting_semaphore(); |
(C++20 起) | |
销毁 counting_semaphore
对象。
[编辑] 注解
仅在已通知了所有线程后,调用析构函数才是安全的。一旦析构函数开始,程序员就必须确保不再有线程试图在 *this 上等待。析构函数不会发出通知解锁所有等待中的线程。