
This whole issue make me think that this problem could be much more easily solved with with a binary semaphore or a non recursive mutex. Then it doesn't matter if the worker thread gets done before the master thread starts to wait. IMHO the model you are describing suits Win32 events a lot more than condition variables. The issue is around "setting the condition prior to somebody waiting on it", which, by definition, works well with events. IE an event would remain signalled, until such time when a thread decides to block on it. At that time, the thread just checks
Hello Matt, Matt Schuckmann wrote on 3/02/2006 at 6:27 a.m.: the event and continues running. Having said all that, the fact remains - win32 events don't exist on unix/linux. However, events and the corresponding multiplexor (WaitForMultipleObjects()) can be implemented using mutexes and condition variables, thus making the the above model easy to program. Best regards, Oleg.