atomic_swap_int
#define atomic_readandclear_int(p) atomic_swap_int(p, 0)
#define atomic_exchange(p, nval) atomic_swap_int((p), (nval))