Namespaces
Variants

std::atomic_flag:: notify_one

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 notify_one ( ) noexcept ;
(1) (C++20以降)
(C++26以降 constexpr)
void notify_one ( ) volatile noexcept ;
(2) (C++20以降)

アトミックな通知操作を実行します。

atomic待機操作(すなわち wait() )でブロックされているスレッドが * this 上に存在する場合、 少なくとも1つ のそのようなスレッドのブロックを解除する。それ以外の場合は何も行わない。

注記

この形式の変更検出は、単純なポーリングや純粋なスピンロックよりも効率的な場合が多いです。

関連項目

(C++20)
通知されるまでスレッドをブロックし、アトミック値が変更されるのを待機
(公開メンバ関数)
通知されるまでスレッドをブロックし、フラグが変更されるのを待機
(関数)
atomic_flag_waitでブロックされているスレッドを通知
(関数)