atomic_flag needs to have public methods.