+ // put_threads_to_sleep() makes all the threads go to sleep just before
+ // to leave think(), at the end of the search. Threads should have already
+ // finished the job and should be idle.
+
+ void put_threads_to_sleep() {
+
+ assert(!AllThreadsShouldSleep);
+
+ AllThreadsShouldSleep = true;
+
+ // Wait for the threads to be all sleeping
+ for (int i = 1; i < ActiveThreads; i++)
+ while (!Threads[i].sleeping);
+ }
+
+