Browse Source

Rewrote wait condition to make sonar happy

Jorrit Rouwe 4 năm trước cách đây
mục cha
commit
228c476c0e
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  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
 }