This version of the bounded buffer monitor uses semaphores instead of Java conditional synchronization. Can you get it to deadlock?
Hint: Shift the slider to the left to run the producer or the consumer faster.
Modify this applet in a way that the deadlock does not occur anymore.
Hint: This example uses a nested monitor. Check the classes BoundedBuffer, DisplayBuffer, and Semaphore.
The result may look like this.