Fix a race in pondering mode

Fixes an hang when playing with ponder ON. Perhaps there is still
a very small race but now it seems engine does not hang anymore.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba
2011-11-26 16:29:54 +01:00
parent c4517c013c
commit ffa75215cc
3 changed files with 17 additions and 13 deletions

View 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