Namespaces
Variants

std:: atomic_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
atomic_notify_one
(C++20)
Free functions for atomic flags
ヘッダーで定義 <atomic>
template < class T >
void atomic_notify_one ( std:: atomic < T > * object ) ;
(1) (C++20以降)
template < class T >
void atomic_notify_one ( volatile std:: atomic < T > * object ) ;
(2) (C++20以降)

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

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

object - > notify_one ( ) と同等です。

目次

パラメータ

object - 通知対象のアトミックオブジェクトへのポインタ

戻り値

(なし)

注記

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

関連項目

(C++20)
アトミックオブジェクトを待機している少なくとも1つのスレッドに通知する
( std::atomic<T> の公開メンバ関数)
(C++20)
アトミックオブジェクトを待機しているすべてのスレッドに通知する
( std::atomic<T> の公開メンバ関数)
atomic_waitでブロックされているすべてのスレッドに通知する
(関数テンプレート)
通知されるまで、かつアトミック値が変更されるまでスレッドをブロックする
(関数テンプレート)