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:
Mathias Agopian
2019-06-28 18:34:29 -07:00
committed by Mathias Agopian
parent 64c95c615a
commit 76027cab85

View File

@@ -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);
}
}