]> git.sesse.net Git - stockfish/blobdiff - src/search.cpp
Careful SMP locking - Fix very occasional hangs
[stockfish] / src / search.cpp
index 8037e6e74f29300065618b16a435e29201a9488e..54a9ec878c44f5b617a30fbc85280de160f49628 100644 (file)
@@ -1622,6 +1622,7 @@ void Thread::idle_loop() {
           else
               assert(false);
 
+          spinlock.acquire();
           assert(searching);
 
           searching = false;
@@ -1633,6 +1634,7 @@ 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