命名空间
变体
操作

std::atomic_flag::test

来自 cppreference.cn
< cpp‎ | atomic‎ | atomic flag
 
 
并发支持库
线程
(C++11)
(C++20)
this_thread 命名空间
(C++11)
(C++11)
(C++11)
协作式取消
互斥
(C++11)
通用锁管理
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
条件变量
(C++11)
信号量
闩锁和屏障
(C++20)
(C++20)
期物
(C++11)
(C++11)
(C++11)
(C++11)
安全回收
(C++26)
Hazard 指针
原子类型
(C++11)
(C++20)
原子类型的初始化
(C++11)(C++20 中已弃用)
(C++11)(C++20 中已弃用)
内存顺序
(C++11)(C++26 中已弃用)
原子操作的自由函数
原子标志的自由函数
 
 
bool test( std::memory_order order =
               std::memory_order_seq_cst ) const volatile noexcept;
(1) (since C++20)
bool test( std::memory_order order =
               std::memory_order_seq_cst ) const noexcept;
(2) (since C++20)

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

如果 order 是 std::memory_order_release 和 std::memory_order_acq_rel 之一,则行为未定义。

目录

[编辑] 参数

order - 内存同步顺序

[编辑] 返回值

原子读取的值。

[编辑] 示例

[编辑] 参见

原子地返回标志的值
(函数) [编辑]