Namespaces
Variants

std::counting_semaphore<LeastMaxValue>:: counting_semaphore

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
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 의 카운터를 초기화하는 데 사용할 값

예외

아무것도 던지지 않습니다.