Namespaces
Variants

std::atomic_flag:: atomic_flag

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
헤더 파일에 정의됨 <atomic>
(1)
atomic_flag ( ) noexcept = default ;
(C++11부터)
(C++20까지)
constexpr atomic_flag ( ) noexcept ;
(C++20부터)
atomic_flag ( const atomic_flag & ) = delete ;
(2) (C++11부터)

새로운 std::atomic_flag 를 생성합니다.

1) 사소한 기본 생성자, std::atomic_flag 를 지정되지 않은 상태로 초기화합니다.
(until C++20)
1) std::atomic_flag 를 클리어 상태로 초기화합니다.
(since C++20)
2) 복사 생성자가 삭제됨; std::atomic_flag 는 복사할 수 없음.

또한, std::atomic_flag ATOMIC_FLAG_INIT 표현식으로 클리어 상태로 값 초기화될 수 있습니다. 정적 저장 기간 을 가진 atomic_flag 의 경우, 이는 정적 초기화 를 보장합니다: 플래그는 정적 객체의 생성자에서 사용될 수 있습니다.

참고 항목

std::atomic_flag false 로 초기화함
(매크로 상수)