Namespaces
Variants

std::barrier<CompletionFunction>:: arrive_and_wait

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

예상 카운트를 원자적으로 1 감소시킨 후, 현재 페이즈의 페이즈 완료 단계가 실행될 때까지 현재 페이즈의 동기화 지점에서 블록합니다. 다음 코드와 동일합니다: wait ( arrive ( ) ) ; .

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

목차

매개변수

(없음)

반환값

(없음)

예외

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

참고 사항

현재 예상 카운트가 이 함수 호출에서 0으로 감소되면, 페이즈 완료 단계가 실행되며 이 함수는 블록하지 않습니다.

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

예제