1
0
mirror of https://github.com/TomHarte/CLK.git synced 2025-02-16 18:30:32 +00:00

Ameliorate for race condition.

This commit is contained in:
Thomas Harte 2023-12-04 09:56:06 -05:00
parent 646c6b08f7
commit 5845ce0a39

View File

@ -128,7 +128,7 @@ template <bool perform_automatically, bool start_immediately = true, typename Pe
while(!should_quit_) { while(!should_quit_) {
// Wait for new actions to be signalled, and grab them. // Wait for new actions to be signalled, and grab them.
std::unique_lock lock(condition_mutex_); std::unique_lock lock(condition_mutex_);
while(actions_.empty()) { while(actions_.empty() && !should_quit_) {
condition_.wait(lock); condition_.wait(lock);
} }
std::swap(actions, actions_); std::swap(actions, actions_);