std::atomic_flag::test

来自cppreference.com
< cpp‎ | atomic‎ | atomic flag
 
 
并发支持库
线程
(C++11)
(C++20)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
原子类型
(C++11)
(C++20)
原子类型的初始化
(C++11)(C++20 中弃用)
(C++11)(C++20 中弃用)
原子操作的自由函数
原子标志的自由函数
内存序
互斥
(C++11)
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩与屏障
(C++20)
(C++20)
future
(C++11)
(C++11)
(C++11)
(C++11)
 
 
(C++20 起)
bool test( std::memory_order order = std::memory_order::seq_cst ) const volatile noexcept;
bool test( std::memory_order order = std::memory_order::seq_cst ) const noexcept;

原子地读取 *this 的值并返回该值。

参数

order - 此操作使用的内存同步顺序:必须不为 std::memory_order::releasestd::memory_order::acq_rel

示例

参阅

原子地返回标志的值
(函数)