std::counting_semaphore<LeastMaxValue>::counting_semaphore
来自cppreference.com
< cpp | thread | counting semaphore
并发支持库
|
|
constexpr explicit counting_semaphore( std::ptrdiff_t desired ); | (1) | (C++20 起) |
counting_semaphore( const counting_semaphore& ) = delete; | (2) | (C++20 起) |
1) 构造一个
std::counting_semaphore
类型的对象,初始化其内部计数器为 desired
。2) 复制构造函数被弃置。
前条件
1)desired >= 0 与 desired <= max() 均为 true。
参数
desired | - | 用于初始化 counting_semaphore 的计数器的值 |
异常
不抛出。