std::atomic_flag_test, std::atomic_flag_test_explicit
From cppreference.com
C++
Feature test macros (C++20)
Concepts library (C++20)
Metaprogramming library (C++11)
Ranges library (C++20)
Filesystem library (C++17)
Concurrency support library (C++11)
Execution control library (C++26)
Concurrency support library
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
Semaphores
Latches and Barriers
Futures
Safe reclamation
Hazard pointers
(C++11)
(C++20)
(C++11)
(C++11)
(C++20)
(C++26)
(C++26)
(C++20)
(C++26)
(C++20)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++26)
(C++11)
(C++11)
(C++17)
(C++11)
(C++14)
(C++11)
(C++11)
(C++11)
(C++11)(C++11)(C++11)(C++11)(C++11)(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++20)(C++20)
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++26)
(C++26)
(C++26)
(C++11)
(C++20)
(C++11)
(C++11)(deprecated in C++20)
(C++11)(deprecated in C++20)
(C++11)
(C++11)
(C++11)(deprecated in C++26)
(C++11)
(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++11)(C++11)
(C++26)(C++26)
(C++26)(C++26)
(C++11)
(C++20)(C++20)
(C++20)
(C++20)
(C++11)(C++11)
(C++11)(C++11)
atomic_flag_testatomic_flag_test_explicit
(C++20)(C++20)
(C++20)(C++20)
(C++20)
(C++20)
Defined in header
<atomic>
bool atomic_flag_test( const volatile std::atomic_flag * object ) noexcept;
(1)
(since C++20)
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;
(3)
(since C++20)
std::memory_order order ) noexcept;
bool atomic_flag_test_explicit( const std::atomic_flag * object,
std::memory_order order ) noexcept;
(4)
(since C++20)
std::memory_order order ) noexcept;
Atomically reads the value of the *object and returns the value.
1,2) The memory synchronization order is std::memory_order_seq_cst .
3,4) The memory synchronization order is order.
If order is one of std::memory_order::release and std::memory_order::acq_rel, the behavior is undefined.
Contents
[edit] Parameters
object
-
pointer to the
atomic_flag
object to read
order
-
the memory synchronization ordering
[edit] Return value
The value atomically read.
[edit] Notes
Feature-test macro | Value | Std | Feature |
---|---|---|---|
__cpp_lib_atomic_flag_test |
201907L |
(C++20) | std::atomic_flag::test
|
[edit] Example
This section is incomplete
Reason: no example
Reason: no example