]> git.sesse.net Git - stockfish/blobdiff - src/thread.cpp
Simplify a condition in search()
[stockfish] / src / thread.cpp
index 901a20b2bed1d67d1301aa8646d46fd2bdf50c80..b599960528a00d2e67c0948d9a93146a04e14023 100644 (file)
@@ -143,7 +143,7 @@ void Thread::wait_for_stop_or_ponderhit() {
   Signals.stopOnPonderhit = true;
 
   mutex.lock();
-  while (!Signals.stop) sleepCondition.wait(mutex);;
+  while (!Signals.stop) sleepCondition.wait(mutex);
   mutex.unlock();
 }
 
@@ -404,7 +404,6 @@ void ThreadPool::wait_for_search_finished() {
 
   Thread* t = main_thread();
   t->mutex.lock();
-  t->sleepCondition.notify_one(); // In case is waiting for stop or ponderhit
   while (!t->do_sleep) sleepCondition.wait(t->mutex);
   t->mutex.unlock();
 }