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.
true if the operations are lock-free, or false otherwise.
| Safety: | |
|---|---|
| Cancellation point | No |
| Interrupt handler | Yes |
| Signal handler | Yes |
| Thread | Yes |