Code example of The Little Book of Semaphores Cap 4: Producer-Consumer Problem