std::atomic_flag:: notify_all
From cppreference.net
<
cpp
|
atomic
|
atomic flag
C++
Concurrency support library
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::atomic_flag
| Member functions | ||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
(C++20)
|
||||
|
atomic_flag::notify_all
(C++20)
|
|
void
notify_all
(
)
noexcept
;
|
(1) |
(seit C++20)
(constexpr seit C++26) |
|
void
notify_all
(
)
volatile
noexcept
;
|
(2) | (seit C++20) |
Führt atomare Benachrichtigungsoperationen aus.
Entblockt alle Threads, die in atomaren Wartevorgängen blockiert sind (d.h. wait() ) auf * this , falls vorhanden; andernfalls geschieht nichts.
Hinweise
Diese Form der Änderungserkennung ist oft effizienter als einfaches Polling oder reine Spinlocks.
Beispiel
|
Dieser Abschnitt ist unvollständig
Grund: Kein Beispiel |
Siehe auch
|
(C++20)
|
blockiert den Thread, bis eine Benachrichtigung erfolgt und der atomare Wert sich ändert
(öffentliche Elementfunktion) |
|
(C++20)
(C++20)
|
blockiert den Thread, bis eine Benachrichtigung erfolgt und das Flag sich ändert
(Funktion) |
|
(C++20)
|
benachrichtigt einen in atomic_flag_wait blockierten Thread
(Funktion) |