std::atomic_flag::test_and_set
< cpp | atomic | atomic flag
定义于头文件
<atomic> |
||
bool test_and_set(std::memory_order order = std::memory_order_seq_cst) volatile noexcept;
|
(1) | (C++11 起) |
bool test_and_set(std::memory_order order = std::memory_order_seq_cst) noexcept;
|
(2) | (C++11 起) |
原子地更改 std::atomic_flag 的状态为设置( true )并返回它先前保有的值。
参数
order | - | 此操作的内存同步顺序 |
参阅
原子地设置标志为 false (公开成员函数) |
|
(C++11)(C++11)
|
原子地设置标志为 true 并返回其先前值 (函数) |
(C++11)
|
为给定的原子操作定义内存顺序约束 (枚举) |