Remove AtomicFlag

fixes #12943