
11 Aug
2008
11 Aug
'08
7:46 p.m.
Zeljko Vrba:
Even worse:
A: push; unlock; gets preempted B: wait_and_pop: succeeds, making the queue empty; unlocks the mutex A: gets scheduled again, notifies the condvar which has no waiters C: wait_and_pop: acquires mutex, sleeps on the condvar
No. C doesn't sleep because the wait is guarded by the predicate the_queue.empty().