+ assert(threads[threadID].state == THREAD_SEARCHING);
+
+ // If this is a slave thread reset to available, instead
+ // if it is a master thread and all slaves have finished
+ // then leave as is to avoid booking by another master,
+ // we will leave idle loop shortly anyhow.
+ if ( !AllThreadsShouldExit
+ && (!waitSp || waitSp->cpus > 0))
+ threads[threadID].state = THREAD_AVAILABLE;