]> git.sesse.net Git - stockfish/commit
Fix a race in idle_loop() exiting
authorMarco Costalba <mcostalba@gmail.com>
Mon, 25 Jan 2010 14:01:20 +0000 (15:01 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 25 Jan 2010 14:02:06 +0000 (15:02 +0100)
commitc5e71f515045029f4d89f1302277217b878fa7a4
treeda4f3aceef619674e8565f0bfe42e67c3567915c
parentc5858ff9aef05c4b6f8423d9a9060296bb826fde
Fix a race in idle_loop() exiting

When pondering threads are put to sleep, but when thinking
the threads are parked in idle_loop in a tight polling loop
checking for workIsWaiting falg.

So before we set the slave's flag workIsWaiting we have to
guarantee that all the slave data is already setup because
slave can start in any moment from there.

Rearrange the last loop to fix this race.

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