std::atomic_flag::test_and_set
來自 cppreference.com
< 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),並返回它之前持有的值。
[編輯] 引數
順序 | - | 記憶體同步順序 |
[編輯] 參閱
原子性地將標誌設定為 false (public member function) | |
原子地將標誌設定為 true 並返回其先前的值 (function) | |
(C++11) |
定義給定原子操作的記憶體排序約束 (enum) |