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) |
(自 C++20 起)
(自 C++26 起为 constexpr) |
|
void
notify_all
(
)
volatile
noexcept
;
|
(2) | (自 C++20 起) |
执行原子通知操作。
解除所有在 * this 上因原子等待操作(即 wait() )而阻塞的线程,如果存在此类线程;否则不执行任何操作。
注释
这种变更检测形式通常比简单轮询或纯自旋锁更高效。
示例
|
本节内容不完整
原因:缺少示例 |
参见
|
(C++20)
|
阻塞线程直至被通知且原子值发生变化
(公开成员函数) |
|
(C++20)
(C++20)
|
阻塞线程直至被通知且标志位发生变化
(函数) |
|
(C++20)
|
通知在 atomic_flag_wait 中阻塞的线程
(函数) |