Mutexes and semaphores can solve many problems, but for some problems the solution can involve a rather complex use of tools.
POSIX provides yet another tool: condition variables which for some kinds of problems provides a clearer solution than using semaphores.
An example helps understand the semantics of condition variables.