std::counting_semaphore<LeastMaxValue>:: max
From cppreference.net
<
cpp
|
thread
|
counting semaphore
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::counting_semaphore
| Member functions | ||||
| Operations | ||||
| Constants | ||||
|
counting_semaphore::max
|
|
constexpr
std::
ptrdiff_t
max
(
)
noexcept
;
|
(自 C++20 起) | |
返回内部计数器的最大可能值,该值大于或等于
LeastMaxValue
。
返回值
内部计数器的最大可能值,以 std::ptrdiff_t 表示。
注释
对于特化版本
binary_semaphore
,
LeastMaxValue
等于
1
。
正如其名称所示,
LeastMaxValue
是
最小
最大值,而非
实际
最大值。因此
max
(
)
可能返回大于
LeastMaxValue
的数值。