}
search(true); // Let's start searching!
-
- // Stop the threads
- Signals.stop = true;
-
- // Wait until all threads have finished
- for (Thread* th : Threads)
- if (th != this)
- th->wait_while(th->searching);
}
// When playing in 'nodes as time' mode, subtract the searched nodes from
wait(Signals.stop);
}
+ // Stop the threads if not already stopped
+ Signals.stop = true;
+
+ // Wait until all threads have finished
+ for (Thread* th : Threads)
+ if (th != this)
+ th->wait_while(th->searching);
+
// Check if there are threads with a better score than main thread.
Thread* bestThread = this;
for (Thread* th : Threads)