std :: atomic
#include <std/atomic.h> source ยท definition
#include <std/atomic.h>
int atomic_cas_int(&int addr, &int expected, int desired)
CAS: if *addr == expected, store desired and return 1; else update *expected to the current value and return 0.