mirror of
https://github.com/TomHarte/CLK.git
synced 2025-01-10 16:30:07 +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);
|
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) {
|
void MultiCRTMachine::perform_serial(const std::function<void (::CRTMachine::Machine *)> &function) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user