On windows, I have a whole range of these mechanisms available, each of which lends itself to certain uses better than others.
The only mechanism I'm aware of for use with pthreads on *nix are condition variables. There must be others: What are they are? Where can I read about them?
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.