add semaphore implementation of producer consumer