Fix race while exiting
authorMarco Costalba <mcostalba@gmail.com>
Wed, 16 Jan 2013 08:26:10 +0000 (09:26 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Wed, 16 Jan 2013 18:58:55 +0000 (19:58 +0100)
commitc465f4c4df1a8ad3d5c1e3759c6aa27b777b8a77
tree90cb9fd0865e7fcfcdd21c660121340360803f96
parent8737b26a23afb36d70cb32e3d53eeac7239685bf
Fix race while exiting

Fix again TimerThread::idle_loop() to prevent a
theoretical race with 'exit' flag in ~Thread().

Indeed in Thread d'tor we raise 'exit' and then
call notify() that is lock protected, so we
have to check again for 'exit' before going to
sleep in idle_loop().

Also same change in Thread::idle_loop() where we
now check for 'exit' before to go to sleep.

No functional change.

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