Solving the Producer/Consumer problem using mutex and semaphores.