(note this is a simplified condition variable without all the POSIX compliance crud).

In C++0x you have condition_variable at the stdlib level, so that is probably the best approach for the future. Unfortunately that future
is still far away. On Pthreads you also have condition_variable (though a rather more complex one). Unfortunately, on Win32 (pre-Vista) you don't
have condition_varaiable at all, so you have to build one of these from OS primitives.

(BTW there are various sources for good condition_var implementations for Win32, such as boost::thread and
Win32 pthreads by Alex Terekhov).

ADDENDUM : really eventcount is the more primitive of the two; it's sort of a mistake that C++0x has provided "condition_var" as a primitive.
They are not trying to provide a full set of OS-level thread control types (eg. they don't provide semaphore, event, what have you) - they
are trying to provide the minimal basic set, and they chose condition_var. They should have done mutex and eventcount, as you can build
everything from that.

(actually there's something perhaps even more primitive that eventcount which is "waitset" which can be easily used to build any of the basic
blocking thread control devices).

which would be a lovely function to use for implementing condition_var (it basically is the heart of condition var - it signals one handle and waits on another handle in one op), but it's Win2k+ only so it's slightly better than Vista+ but still not actually usable in code that has to work on any Windows.

I don't really understand who is writing code that knows they can use Vista+ only APIs. I guess people who release many versions for various hardware/OS combos.