From 76027cab85a5c50ba558d5c4102b677af55cea8e Mon Sep 17 00:00:00 2001 From: Mathias Agopian Date: Fri, 28 Jun 2019 18:34:29 -0700 Subject: [PATCH] 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. --- libs/utils/src/JobSystem.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/utils/src/JobSystem.cpp b/libs/utils/src/JobSystem.cpp index 713996457d..eaaa047d48 100644 --- a/libs/utils/src/JobSystem.cpp +++ b/libs/utils/src/JobSystem.cpp @@ -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 lock(mWaiterLock); - while (!hasJobCompleted(job) && !exitRequested()) { + if (!hasJobCompleted(job) && !exitRequested()) { mWaiterCondition.wait(lock); } }