std::atomic_ref<T>::is_lock_free
From cppreference.com
< cpp | atomic | atomic ref
C++
Concurrency support library
|
|
std::atomic_ref
Member functions | ||||
atomic_ref::is_lock_free | ||||
(C++26)
|
||||
Operations for arithmetic types (except bool and pointer-to-object)
|
||||
Operations for integral types (except bool and pointer-to-object)
|
||||
(C++26)
|
||||
(C++26)
|
||||
Operations for integral types (except bool ) | ||||
Constants | ||||
bool is_lock_free() const noexcept;
|
(since C++20) | |
Checks whether the atomic operations on this object are lock-free.
Parameters
(none)
Return value
true if the atomic operations on this object are lock-free, false
Notes
All atomic types except for std::atomic_flag may be implemented using mutexes or other locking operations, rather than using the lock-free atomic CPU instructions. Atomic types are also allowed to be sometimes
The C++ standard recommends (but does not require) that lock-free atomic operations are also address-free, that is, suitable for communication between processes using shared memory.
Example
This section is incomplete Reason: no example |
See also
[static]
|
indicates that the type is always lock-free (public static member constant) |