Buffer Example help.

Hey guys,
Been given this program that was incomplete, I was to add in the missing parts. The idea is that there is a buffer and a producer adding to it and a consumer removing from it. Code is attached below, bits that I have added are in RED.