adding code for solving the producer consumer problem using semaphores and mutual exclusion