Fixes a not so rare crash (once every 100 games)
newly introduced. Unfortunatly I am still not
able to figure out why :-(
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
void Thread::wake_up() {
lock_grab(sleepLock);
- do_sleep = false;
cond_signal(sleepCond);
lock_release(sleepLock);
}
for (int i = 0; i < size(); i++)
{
threads[i]->maxPly = 0;
+ threads[i]->do_sleep = false;
if (!useSleepingThreads)
threads[i]->wake_up();
if (searchMoves.empty() || searchMoves.count(ml.move()))
RootMoves.push_back(RootMove(ml.move()));
+ threads[0]->do_sleep = false;
threads[0]->wake_up();
}