Consumer Code
1.If buffer is empty make sleep the consumer
2.Else take an item from the buffer
3.Decerement count of items
4.If buffer is not full wake the producer
5.Consume the item
Buffer
Modified Producer Code
1.Create a new item to put in the buffer.
2.If buffer is full make sleep producer.
3.Else put the item in the buffer.
4.Increment count of items.
5.If buffer is not empty wake the consumer.
down(empty);
down(mutex);
up(mutex);
up(full);