using the new atomic_flag