OPTIMIZATION: Only notify the condition variable when needed
Former-commit-id: 11f07b49c613f54cef682da1e3c8fc54918809b0
This commit is contained in:
1 parent
22b98b86fe
commit
4262bed9de
1 file changed
+2
-1
+2
-1
@@ -6996,9 +6996,10 @@ void OnTerminate()
|
||||
void wakeTimeThread() {
|
||||
updateCachedTime();
|
||||
std::lock_guard<std::mutex> lock(time_thread_mutex);
|
||||
if (sleeping_threads >= cserver.cthreads)
|
||||
time_thread_cv.notify_one();
|
||||
sleeping_threads--;
|
||||
serverAssert(sleeping_threads >= 0);
|
||||
time_thread_cv.notify_one();
|
||||
}
|
||||
|
||||
void *timeThreadMain(void*) {
|
||||
|
||||
Reference in new issue
Block a user