Spread a little panic().
Switch to std::atomic_flag.