mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 10:57:43 +00:00
Rework lock protecting
When changing 'search' and 'splitPointsSize' we have to use thread locks, not split point ones, because can_join() is called under the formers. Verified succesfully with 24 hours toruture tests with 20 cores machine by Louis Zulli: it does not hangs. Verifyed for no regressions with STC, 7 threads: LLR: 2.94 (-2.94,2.94) [-3.00,1.00] Total: 52804 W: 8159 L: 8087 D: 36558 No functional change.
This commit is contained in:
+5
-2
@@ -1622,11 +1622,15 @@ void Thread::idle_loop() {
|
||||
else
|
||||
assert(false);
|
||||
|
||||
spinlock.acquire();
|
||||
assert(searching);
|
||||
|
||||
spinlock.acquire();
|
||||
|
||||
searching = false;
|
||||
activePosition = nullptr;
|
||||
|
||||
spinlock.release();
|
||||
|
||||
sp->slavesMask.reset(idx);
|
||||
sp->allSlavesSearching = false;
|
||||
sp->nodes += pos.nodes_searched();
|
||||
@@ -1634,7 +1638,6 @@ void Thread::idle_loop() {
|
||||
// After releasing the lock we can't access any SplitPoint related data
|
||||
// in a safe way because it could have been released under our feet by
|
||||
// the sp master.
|
||||
spinlock.release();
|
||||
sp->spinlock.release();
|
||||
|
||||
// Try to late join to another split point if none of its slaves has
|
||||
|
||||
Reference in New Issue
Block a user