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)
|
为给定的原子操作定义内存定序约束 (枚举) |