1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-08-09 05:25:01 +00:00

Fix construction order.

This commit is contained in:
Thomas Harte
2022-07-07 20:09:37 -04:00
parent 07ce0f0133
commit 5c3084c37c

View File

@@ -84,10 +84,13 @@ template <typename Performer> class AsyncUpdater {
std::unique_ptr<ActionVector> actions_; std::unique_ptr<ActionVector> actions_;
// Necessary synchronisation parts. // Necessary synchronisation parts.
std::thread performer_thread_; std::atomic<bool> should_quit = false;
std::mutex condition_mutex_; std::mutex condition_mutex_;
std::condition_variable condition_; std::condition_variable condition_;
std::atomic<bool> should_quit = false;
// Ensure the thread isn't constructed until after the mutex
// and condition variable.
std::thread performer_thread_;
}; };