Explorar o código

Rewrote wait condition to make sonar happy

Jorrit Rouwe %!s(int64=4) %!d(string=hai) anos
pai
achega
228c476c0e
Modificáronse 1 ficheiros con 1 adicións e 2 borrados
  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
 }