Defined in header <atomic> | ||
---|---|---|
(1) | (since C++20) | |
bool atomic_flag_test( const volatile std::atomic_flag* object ) noexcept; | ||
bool atomic_flag_test( const std::atomic_flag* object ) noexcept; | ||
(2) | (since C++20) | |
bool atomic_flag_test_explicit( const volatile std::atomic_flag* object, std::memory_order order ) noexcept; | ||
bool atomic_flag_test_explicit( const std::atomic_flag* object, std::memory_order order ) noexcept; |
Atomically reads the value of the *object
and returns the value.
object->test(std::memory_order_seq_cst)
.object->test(order)
.object | - | pointer to the atomic_flag object to read |
order | - | the memory synchronization ordering for this operation: must not be std::memory_order::release or std::memory_order::acq_rel |
The value atomically read.
Feature-test macro |
---|
__cpp_lib_atomic_flag_test |
(C++20) | atomically returns the value of the flag (public member function of std::atomic_flag ) |
© cppreference.com
Licensed under the Creative Commons Attribution-ShareAlike Unported License v3.0.
https://en.cppreference.com/w/cpp/atomic/atomic_flag_test