Condition Variable
Wait(mutex, condition)
- mutex is automatically re-aquired and released on wait
Signal(condition)
- Notify only on thread waiting on condition
Broadcast(condition)
- Notify all threads
Wait(mutex, cond) {
// auto release mutex and go on wait queue
// wait...wait
// remove from queue
// re-aquire mutex
// exit the wait operation
}