std::counting_semaphore<LeastMaxValue>:: counting_semaphore
From cppreference.net
<
cpp
|
thread
|
counting semaphore
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::counting_semaphore
| Member functions | ||||
|
counting_semaphore::counting_semaphore
|
||||
| Operations | ||||
| Constants | ||||
|
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
计数器的值
|
异常
不抛出任何异常。