use ATOMIC_SET_IF() now that it's available