Updated: April 19, 2023 |
Determine whether atomic operations on an object are lock-free (C11)
#include <stdatomic.h> _Bool atomic_is_lock_free( const volatile A* obj );
None.
The atomic_is_lock_free() function is a generic function that determines whether or not atomic operations on the given type of object are lock-free. This depends on your target platform; if the compiler can't generate lock-free instructions for your target, you need to link your program against libatomic.
This function isn't atomic.
The implementation of atomic functions may depend on the architecture. For more information, see LL/SC vs LSE atomic operations in the description in Building Embedded Systems of the cpuinfo area of the system page.
true if the operations are lock-free, or false otherwise.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Yes |
Signal handler | Yes |
Thread | Yes |