I understand the OPs question and your answer such that there is no semantic
difference between notfy_one() and notify_all(). I agree that for *some*
uses of condvars there really is no difference. Namely when the thread that
has won the battle for the mutex *never* releases it. However that is a
rather academic case, isn't it?
The thread that has successfully acquired the mutex will usually at some
later point release the mutex (if only to wait on the condvar again) what
allows another thread that is currently blocking on the mutex to acquire it.
In other words, notify_all() wakes *all* waiting threads. Sure, they can
then acquire and later release the mutex only one by one, but the fact
remains that they will eventually all go through the "critical section".
OTOH, notify_one() only wakes exactly one thread.
I can't speak for POSIX condvars but the implementation in
"thread/condition.hpp" seems to do it exactly this way, even for POSIX.
[ See http://www.yqcomputer.com/
[ comp.lang.c++.moderated. First time posters: Do this! ]