- // If there is nothing to do, sleep.
- while( !exit
- && !(this_sp && this_sp->slavesMask.none())
- && !searching)
- {
- if ( !this_sp
- && !Threads.main()->thinking)
- {
- std::unique_lock<Mutex> lk(mutex);
- while (!exit && !Threads.main()->thinking)
- sleepCondition.wait(lk);
- }
- else
- std::this_thread::yield();
- }
-