std::atomic_flag::test_and_set
来自cppreference.com
< cpp | atomic | atomic flag
并发支持库
|
|
std::atomic_flag
成员函数 | ||||
atomic_flag::test_and_set
|
||||
(C++20)
|
||||
(C++20)
|
||||
(C++20)
|
||||
(C++20)
|
在标头
<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)
|
为给定的原子操作定义内存顺序约束 (枚举) |