Namespaces
Variants

std::latch:: count_down

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

호출자를 차단하지 않고 내부 카운터를 n 만큼 원자적으로 감소시킵니다.

만약 n 이 내부 카운터의 값보다 크거나 음수인 경우, 동작은 정의되지 않습니다.

이 연산은 strongly happens-before latch 에서 해제된 모든 호출보다 강력하게 선행합니다.

매개변수

n - 내부 카운터가 감소되는 값

반환값

(없음)

예외

오류 발생 시 뮤텍스 타입에 허용되는 오류 코드와 함께 std::system_error 를 발생시킵니다.