fix a JobSystem bug in waitAndRelease()
We were not checking for jobs to execute during waitAndRelease(), so this thread would essentially not participate to the work pool.
This commit is contained in:
committed by
Mathias Agopian
parent
64c95c615a
commit
76027cab85
@@ -428,7 +428,7 @@ void JobSystem::waitAndRelease(Job*& job) noexcept {
|
||||
// test if job has completed first, to possibly avoid taking the lock
|
||||
if (!hasJobCompleted(job)) {
|
||||
std::unique_lock<Mutex> lock(mWaiterLock);
|
||||
while (!hasJobCompleted(job) && !exitRequested()) {
|
||||
if (!hasJobCompleted(job) && !exitRequested()) {
|
||||
mWaiterCondition.wait(lock);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user