std::counting_semaphore<LeastMaxValue>::~counting_semaphore
来自 cppreference.cn
< cpp | thread | counting semaphore
~counting_semaphore(); |
(since C++20) | |
销毁 counting_semaphore
对象。
[编辑] 注解
只有在所有线程都已收到通知的情况下调用析构函数才是安全的。程序员必须确保一旦析构函数启动,没有线程尝试等待 *this。析构函数不会通知和释放任何等待线程。