What’s the mutex for in pthread_cond_wait()?
You might notice that you have to pass a mutex to pthread_cond_wait, when you are thinking to yourself "Why do I need a mutex when all I want to do is signal a waiting thread?"This is one of those questions that doesn't have an immediately obvious answer. Well, you are right that you can just [...]