Update producer-consumer problem

consumer will immediately return if no event is in the buffer