
19 Sep
2011
19 Sep
'11
3:48 p.m.
You need to be careful with condition variables, as they typically edge-triggered rather than level-triggered. If they are edge-triggered and the calculation completes and signals before anything is actually waiting on the CV then the waiter will not be signaled.
That's why CV should be used with a state variable.