Namespaces
Variants

std:: atomic_notify_all

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_all
(C++20)
Free functions for atomic flags
Definiert im Header <atomic>
template < class T >
void atomic_notify_all ( std:: atomic < T > * object ) ;
(1) (seit C++20)
template < class T >
void atomic_notify_all ( volatile std:: atomic < T > * object ) ;
(2) (seit C++20)

Führt atomare Benachrichtigungsoperationen aus.

Entblockt alle Threads, die in atomaren Wartevorgängen blockiert sind (d.h. std::atomic_wait() , std::atomic_wait_explicit() , oder std::atomic::wait() ) auf * object , falls vorhanden; andernfalls tut es nichts.

Entspricht object - > notify_all ( ) .

Inhaltsverzeichnis

Parameter

object - Zeiger auf das atomare Objekt, das benachrichtigt werden soll

Rückgabewert

(keine)

Hinweise

Diese Form der Änderungserkennung ist oft effizienter als einfaches Polling oder reine Spinlocks.

Beispiel

Siehe auch

(C++20)
benachrichtigt mindestens einen auf das atomare Objekt wartenden Thread
(öffentliche Elementfunktion von std::atomic<T> )
(C++20)
benachrichtigt alle auf das atomare Objekt wartenden Threads
(öffentliche Elementfunktion von std::atomic<T> )
blockiert den Thread bis zur Benachrichtigung und Änderung des atomaren Werts
(Funktionstemplate)
benachrichtigt einen in atomic_wait blockierten Thread
(Funktionstemplate)