Question: Pthread _ mutex _ lock ( &lock ) ; while ( ready = = 0 ) Pthread _ cond _ wait ( &cond, &lock )
Pthreadmutexlock&lock;
whileready
Pthreadcondwait&cond, &lock;
Pthreadmutexunlock&lock;
In above section of code, what happens with method call of wait&cond, &lock Choose all answers applicable.
The calling thread relinquishs the lock.
The calling thread suspends execution and enters into a waiting state.
The calling thread, after being notified of the waited condition, will reacquire the lock.
After reacquiring the lock, the waken thread will check the condition in while ready If the condition is true, the calling thread will proceed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
