std::atomic_flag::test_and_set
STD::原子[医]旗子::测试[医]和[医]集
Defined in header | | |
---|---|---|
bool test_and_set(std::memory_order order = std::memory_order_seq_cst) volatile; | (1) | (since C++11) |
bool test_and_set(std::memory_order order = std::memory_order_seq_cst | (2) | (since C++11) |
原子地更改std::atomic_flag
设置%28true
%29并返回它以前持有的值。
参数
order | - | the memory synchronization ordering for this operation |
---|
例外
noexcept
规格:
noexcept
另见
clear | atomically sets flag to false (public member function) |
---|---|
atomic_flag_test_and_setatomic_flag_test_and_set_explicit (C++11)(C++11) | atomically sets the flag to true and returns its previous value (function) |
memory_order (C++11) | defines memory ordering constraints for the given atomic operation (typedef) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。