Namespaces
Variants

std::counting_semaphore<LeastMaxValue>:: release

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
void release ( std:: ptrdiff_t update = 1 ) ;
(C++20부터)

내부 카운터를 update 값만큼 원자적으로 증가시킵니다. 0 보다 크게 되기를 기다리고 있는 스레드(들), 예를 들어 acquire 에서 블록된 스레드들은 이후 차단 해제됩니다.

이 연산은 해당 효과들의 결과를 관찰하는 try_acquire 호출들보다 강력하게 선행 발생합니다.

목차

사전 조건

update >= 0 update <= max ( ) - counter 모두 true 입니다. 여기서 counter 는 내부 카운터의 값입니다.

매개변수

update - 내부 카운터를 증가시킬 값

예외

다음을 throw할 수 있습니다 std::system_error .

참고 항목

내부 카운터를 감소시키거나 가능할 때까지 블록
(public member function)
블로킹 없이 내부 카운터 감소 시도
(public member function)
내부 카운터 감소 시도, 최대 지정 시간 동안 블로킹
(public member function)
내부 카운터 감소 시도, 지정 시간까지 블로킹
(public member function)