diff --git a/libs/utils/include/utils/JobSystem.h b/libs/utils/include/utils/JobSystem.h index d88d6519e29..0dbe0393006 100644 --- a/libs/utils/include/utils/JobSystem.h +++ b/libs/utils/include/utils/JobSystem.h @@ -70,8 +70,7 @@ class JobSystem { uint16_t parent; // 2 | 2 std::atomic runningJobCount = { 1 }; // 2 | 2 mutable std::atomic refCount = { 1 }; // 2 | 2 - std::atomic_bool hasWaiter = { false }; // 1 | 1 - // 5 | 1 (padding) + // 6 | 2 (padding) // 64 | 64 }; diff --git a/libs/utils/src/JobSystem.cpp b/libs/utils/src/JobSystem.cpp index 1e15496418e..2c5d7f9d1a6 100644 --- a/libs/utils/src/JobSystem.cpp +++ b/libs/utils/src/JobSystem.cpp @@ -321,7 +321,7 @@ void JobSystem::finish(Job* job) noexcept { std::atomic_thread_fence(std::memory_order_acquire); #endif // no more work, destroy this job and notify its the parent - notify = notify || job->hasWaiter.load(); + notify = true; Job* const parent = job->parent == 0x7FFF ? nullptr : &storage[job->parent]; decRef(job); job = parent; @@ -427,7 +427,6 @@ 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); - job->hasWaiter.store(true); while (!hasJobCompleted(job) && !exitRequested()) { mWaiterCondition.wait(lock); }