]> git.sesse.net Git - stockfish/commit
Fix 'stop' flag changed out of lock protection
authorMarco Costalba <mcostalba@gmail.com>
Sun, 14 Feb 2010 12:31:05 +0000 (13:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 14 Feb 2010 12:43:26 +0000 (13:43 +0100)
commit8eae6a95fb3b446e2782be12aff519164e521e4d
tree21e71fbec2f19f9dec2f175ad09382acb1a2d53d
parent2b740f549534aff950330eff0f4806da71c76726
Fix 'stop' flag changed out of lock protection

This is the first nice effect of previous patch !

Because thread_should_stop() should be declared 'const' we
need to remove the setting of 'stop' flag to true that
turns out to be a bug because thread_should_stop() is called
outside from lock protection while 'stop' flag is a volatile
shared variable so cannot be changed when not in lock.

Note that this bugs fires ONLY when we use more then 2 threads,
so commonly only in a QUAD or OCTAL machine.

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