atomic_flag
is anatomic boolean
type variable that is guaranteed to be lock-free.
It is used to provide synchronization within threads in programs. Unlikeatomic_bool
,
atomic_flag
does not provide load or store operations.
Atomic variables are not guaranteed to be lock-free. It depends on implementation, e.g: Atomic access can be provided by spin locks.