Namespaces
Variants

std::barrier<CompletionFunction>:: arrive_and_drop

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 arrive_and_drop ( ) ;
(C++20부터)

모든 후속 단계의 초기 예상 카운트를 1만큼 감소시킨 다음, 현재 단계의 예상 카운트를 1만큼 감소시킵니다.

이 함수는 원자적으로 실행됩니다. 이 함수에 대한 호출은 strongly happens-before 현재 단계의 단계 완료 시작 전에 강력하게 발생합니다.

현재 단계의 예상 카운트가 0일 경우 동작은 정의되지 않습니다.

목차

매개변수

(없음)

반환값

(없음)

예외

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

참고 사항

이 함수는 현재 단계의 완료 단계를 시작할 수 있습니다.

이 함수를 호출하기 전 현재 예상 카운트가 0인 경우, 이후 모든 단계의 초기 예상 카운트도 0이 되며, 이는 barrier 가 재사용될 수 없음을 의미합니다.

예제