Fix a race in pondering mode
[stockfish] / src / thread.cpp
index 2978f188b6878be190a4c2b366e509489ac27a99..e48ea6fd38e6cc22188c5fb20029353f84966309 100644 (file)
@@ -438,6 +438,9 @@ void ThreadsManager::start_thinking(bool asyncMode) {
   while (!main.do_sleep)
       cond_wait(&sleepCond, &main.sleepLock);
 
+  // Reset signals before to start the search
+  memset((void*)&Search::Signals, 0, sizeof(Search::Signals));
+
   main.do_sleep = false;
   cond_signal(&main.sleepCond); // Wake up main thread