1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Be sure we exit while loop with lock held

This fixes an hang introduced by recent locking
rewrite patch.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-01-27 19:23:16 +01:00
parent cd112ee8eb
commit 62b43130e2

View file

@ -1990,7 +1990,10 @@ namespace {
assert(value > -VALUE_INFINITE && value < VALUE_INFINITE);
if (thread_should_stop(threadID))
{
lock_grab(&(sp->lock));
break;
}
// New best move?
if (value > sp->bestValue) // Less then 2% of cases
@ -2124,7 +2127,10 @@ namespace {
assert(value > -VALUE_INFINITE && value < VALUE_INFINITE);
if (thread_should_stop(threadID))
{
lock_grab(&(sp->lock));
break;
}
// New best move?
if (value > sp->bestValue) // Less then 2% of cases