-// Thread::notify_one() wakes up the thread when there is some search to do
-
-void Thread::notify_one() {
-
- mutex.lock();
- sleepCondition.notify_one();
- mutex.unlock();
-}
-
-
-// Thread::wait_for() set the thread to sleep until condition 'b' turns true
-
-void Thread::wait_for(volatile const bool& b) {
-
- mutex.lock();
- while (!b) sleepCondition.wait(mutex);
- mutex.unlock();
-}
-
-
-// Thread::cutoff_occurred() checks whether a beta cutoff has occurred in the
-// current active split point, or in some ancestor of the split point.
-
-bool Thread::cutoff_occurred() const {
-
- for (SplitPoint* sp = activeSplitPoint; sp; sp = sp->parent)
- if (sp->cutoff)
- return true;
-
- return false;
-}
-
-
-// Thread::is_available_to() checks whether the thread is available to help the
-// thread 'master' at a split point. An obvious requirement is that thread must
-// be idle. With more than two threads, this is not sufficient: If the thread is
-// the master of some split point, it is only available as a slave to the slaves
-// which are busy searching the split point at the top of slaves split point
-// stack (the "helpful master concept" in YBWC terminology).
-
-bool Thread::is_available_to(Thread* master) const {
-
- if (searching)
- return false;
-
- // Make a local copy to be sure doesn't become zero under our feet while
- // testing next condition and so leading to an out of bound access.
- int size = splitPointsSize;
-
- // No split points means that the thread is available as a slave for any
- // other thread otherwise apply the "helpful master" concept if possible.
- return !size || (splitPoints[size - 1].slavesMask & (1ULL << master->idx));
-}
-
-