Browse Source

Rewrote wait condition to make sonar happy

Jorrit Rouwe 4 years ago
parent
commit
228c476c0e
1 changed files with 1 additions and 2 deletions
  1. 1 2
      Jolt/Core/JobSystemThreadPool.cpp

+ 1 - 2
Jolt/Core/JobSystemThreadPool.cpp

@@ -70,8 +70,7 @@ void JobSystemThreadPool::Semaphore::Acquire(uint inNumber)
 #else
 	unique_lock<mutex> lock(mLock);
 	mCount -= (int)inNumber;
-	while (mCount < 0)
-		mWaitVariable.wait(lock);
+	mWaitVariable.wait(lock, [this]() { return mCount >= 0; });
 #endif
 }