mirror of
https://github.com/TomHarte/CLK.git
synced 2024-12-23 05:29:23 +00:00
Ensures perform_parallel
doesn't lock up if all machines complete prior to reaching condition.wait
.
This commit is contained in:
parent
6b8c223804
commit
7ea4ca00dc
@ -42,7 +42,7 @@ void MultiCRTMachine::perform_parallel(const std::function<void(::CRTMachine::Ma
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> lock(mutex);
|
||||
condition.wait(lock, [&outstanding_machines] { return !outstanding_machines; });
|
||||
if(outstanding_machines) condition.wait(lock, [&outstanding_machines] { return !outstanding_machines; });
|
||||
}
|
||||
|
||||
void MultiCRTMachine::perform_serial(const std::function<void (::CRTMachine::Machine *)> &function) {
|
||||
|
Loading…
Reference in New Issue
Block a user