diff --git a/Concurrency/AsyncUpdater.hpp b/Concurrency/AsyncUpdater.hpp index 12b937895..62625d452 100644 --- a/Concurrency/AsyncUpdater.hpp +++ b/Concurrency/AsyncUpdater.hpp @@ -84,10 +84,13 @@ template class AsyncUpdater { std::unique_ptr actions_; // Necessary synchronisation parts. - std::thread performer_thread_; + std::atomic should_quit = false; std::mutex condition_mutex_; std::condition_variable condition_; - std::atomic should_quit = false; + + // Ensure the thread isn't constructed until after the mutex + // and condition variable. + std::thread performer_thread_; };