5.4.1 Concept of Monitors(8/10) Condition variables support three operations 1. Wait(Lock lock, Condition c): atomic (release lock go to sleep), when the process wakes up it re- acquires lock 2. Signal( Condition c): wake up waiting thread, if one exists. Otherwise, it does nothing 3. Broadcast(: wake up all waiting threads Rule: thread must hold the lock when doing condition variable operations5.4.1 Concept of Monitors(8/10) • Condition variables support three operations: • 1. Wait(Lock lock,Condition c): atomic (release lock, go to sleep), when the process wakes up it reacquires lock. • 2. Signal(Condition c): wake up waiting thread, if one exists. Otherwise, it does nothing. • 3. Broadcast(): wake up all waiting threads • Rule: thread must hold the lock when doing condition variable operations. 13