]> git.sesse.net Git - stockfish/commit
Fix some races in SMP code
authorMarco Costalba <mcostalba@gmail.com>
Sun, 24 Jan 2010 12:46:27 +0000 (13:46 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 24 Jan 2010 13:30:09 +0000 (14:30 +0100)
commit3975a2b94f00dc9f3ead1589436256a39120368a
tree7b47a2ebdb5a11353efa704ef4a21df0e52fddce
parenteb6ddd54f11700ac523792a6411c11d2fba1a511
Fix some races in SMP code

When a search fails high then sp->alpha is increased and
slave threads are requested to stop.

So we have to check for a stop request before to start a search
otherwise we could end up with sp->alpha >= sp->beta
leading to an assert in debug run in search_pv().

This patch fixes the assert and get rid of some of possible races.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp