+
+ set_size(Options["Threads"].value<int>());
+}
+
+
+// set_size() changes the number of active threads and raises do_sleep flag for
+// all the unused threads that will go immediately to sleep.
+
+void ThreadsManager::set_size(int cnt) {
+
+ assert(cnt > 0 && cnt <= MAX_THREADS);
+
+ activeThreads = cnt;
+
+ for (int i = 0; i < MAX_THREADS; i++)
+ threads[i].do_sleep = !(i < activeThreads);