]> git.sesse.net Git - stockfish/commitdiff
Fix race in ThreadsManager::sleep()
authorMarco Costalba <mcostalba@gmail.com>
Sun, 25 Mar 2012 15:31:50 +0000 (16:31 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 25 Mar 2012 15:37:48 +0000 (16:37 +0100)
We cannot set do_sleep flag of main thread before
"bestmove" is sent to GUI, otherwise GUI could send
immediately the next "go" command that triggers
start_thinking() and because do_sleep is set UI
thread resets the flag to launch a new search. But
when shortly after main thread returns to main_loop()
flag is incorrectly reset and main thread goes to sleep
hanging the engine.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>

No differences found