inside a thread, if the conditional variable is changed to satisfy another thread which is on the waiting thread list. Does the current thread give up the global mutex and blocks itself until another thread gives up the mutex?

boost::mutex mutex;
boost::condition cond;
bool data_ready=false;
:
void thread1(){
    boost::mutex::scoped_lock lock(mutex);
 
...//do some work
    data_ready=true;
    cond.notify_one() //assume the condition is satisfied.
     //do more work    -------my question is will this part continue? or thread2 will wake up and block thread 1?

}

void thread2(){
    boost::mutex::scoped_lock lock(mutex);
     while ( !data_ready)
     {
         cond.wait(lock);
     }
    ....//do work
}


 

--
Lei(Oddo) Zhang
70 Symonds Street
Engineering Science Department