Summary: make it std::atomic
Reviewed By: @tudor
Differential Revision:
D2191861
std::chrono::steady_clock::now().time_since_epoch()).count();
}
- // TODO: Read stop_ atomically with an acquire barrier.
- while (!stop_) {
+ while (!stop_.load(std::memory_order_acquire)) {
++nextLoopCnt_;
// Run the before loop callbacks
// stop_ is set by terminateLoopSoon() and is used by the main loop
// to determine if it should exit
- bool stop_;
+ std::atomic<bool> stop_;
// The ID of the thread running the main loop.
// 0 if loop is not running.