Updated: April 19, 2023 |
Generic memory order-dependent fence synchronization primitive (C11)
#include <stdatomic.h> void atomic_thread_fence( memory_order order );
The atomic_thread_fence() function establishes a memory-synchronization ordering of non-atomic and relaxed atomic accesses, as instructed by order, without an associated atomic operation.
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.
Safety: | |
---|---|
Cancellation point | No |
Interrupt handler | Read the Caveats |
Signal handler | Read the Caveats |
Thread | Yes |
If this function is lock-free (see atomic_is_lock_free()), it's safe to call it from an ISR or signal handler.