Atomically clear a flag (C11)
#include <stdatomic.h> void atomic_flag_clear( volatile atomic_flag *obj ); void atomic_flag_clear_explicit( volatile atomic_flag *obj, memory_order order );
The atomic_flag_clear() and atomic_flag_clear_explicit() functions atomically clear the given atomic flag. The atomic_flag_clear() function orders memory access according to memory_order_seq_cst; atomic_flag_clear_explicit() orders them as specified by order.
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.