| Updated: October 28, 2024 | 
Initialize an atomic object (C11)
#include <stdatomic.h>
void atomic_init( volatile A* obj,
                  C desired );
The atomic_init() function is a generic function that initializes the value of an atomic object. 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.
| 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.