std::atomic_flag_test_and_set
From Cppreference
Defined in header <atomic>
|
||
bool atomic_flag_test_and_set( volatile std::atomic_flag* p );
|
(1) | (C++11 feature) |
bool atomic_flag_test_and_set( std::atomic_flag* p );
|
(2) | (C++11 feature) |
bool atomic_flag_test_and_set_explicit( volatile std::atomic_flag* p,
std::memory_order order ); |
(3) | (C++11 feature) |
bool atomic_flag_test_and_set_explicit( std::atomic_flag* p,
std::memory_order order ); |
(4) | (C++11 feature) |
Atomically changes the state of a std::atomic_flag pointed to by p to set (true) and returns the value it held before.
Contents |
[edit] Parameters
p | - | pointer to std::atomic_flag to access |
order | - | the memory sycnhronization ordering for this operation |
[edit] Exceptions
[edit] Equivalent definition
First version |
---|
bool atomic_flag_test_and_set( volatile std::atomic_flag* p ) { return p->test_and_set(); } |
Second version |
bool atomic_flag_test_and_set( std::atomic_flag* p ) { return p->test_and_set(); } |
Third version |
bool atomic_flag_test_and_set_explicit( volatile std::atomic_flag* p, std::memory_order order ) { return p->test_and_set(order); } |
Fourth version |
bool atomic_flag_test_and_set_explicit( std::atomic_flag* p, std::memory_order order ) { return p->test_and_set(order); } |
[edit] See also
|
the lock-free boolean atomic type (class) |
||
|
atomically sets the value of the flag to false (function) |
||
|
defines memory ordering constraints for the given atomic operation (typedef) |