mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-25 11:36:51 +08:00
When allocating a slave we set both is_searching and splitPoint under lock protection. Unfortunatly the order in which the variables are set is not defined. This article was very clarifying: http://software.intel.com/en-us/blogs/2007/11/30/volatile-almost-useless-for-multi-threaded-programming/ So when in idle loop we test for is_searching and then access splitPoint, it could happen that splitPoint is still not updated leading to a possible crash. Fix the race lock protecting splitPoint access. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>