mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 19:16:49 +08:00
Fix another setting of a flag out of lock protection
In this case is dangerous because in split() we reset the flag to false, but if it was set due to a cut-off higher in the tree we completely miss that and go on with the full search. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
@@ -2904,10 +2904,16 @@ namespace {
|
||||
for (int i = 0; i < ActiveThreads; i++)
|
||||
splitPoint->slaves[i] = 0;
|
||||
|
||||
threads[master].idle = false;
|
||||
threads[master].stopRequest = false;
|
||||
threads[master].splitPoint = splitPoint;
|
||||
|
||||
// If we are here it means we are not idle
|
||||
assert(!threads[master].idle);
|
||||
|
||||
// Following assert could fail because we could be slave of a master
|
||||
// thread that has just raised a stop request. Note that stopRequest
|
||||
// can be changed with only splitPoint::lock held, not with MPLock.
|
||||
/* assert(!threads[master].stopRequest); */
|
||||
|
||||
// Allocate available threads setting idle flag to false
|
||||
for (int i = 0; i < ActiveThreads && splitPoint->cpus < MaxThreadsPerSplitPoint; i++)
|
||||
if (thread_is_available(i, master))
|
||||
|
||||
Reference in New Issue
Block a user