1
0
mirror of https://github.com/TomHarte/CLK.git synced 2024-06-01 22:41:32 +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_;
// Necessary synchronisation parts.
std::thread performer_thread_;
std::atomic<bool> should_quit = false;
std::mutex condition_mutex_;
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_;
};