Subject Name: Nested Monitor
Souce Code Language: Java
Number of Versions: 1
Number of Variants: 2
   - orig
   - fixed
Error expected:
   orig: Deadlock
   fixed: no error
Non-determinisitc: yes

***orig***
LOC: 52 (noncomment Java source code)
Classes: 5
Methods: 10
Fields: 5
Statements: 49
wait() call: 1
notifyAll() call: 1
Sync blocks: 4
Thread start() calls: 2
New expressions: 3

***fixed***
LOC: 52 (noncomment Java source code)
Classes: 5
Methods: 10
Fields: 5
Statements: 49
wait() call: 1
notifyAll() call: 1
Sync blocks: 2
Thread start() calls: 2
New expressions: 3

The buffer size is set to 5 (SIZE=5) in the original version. In the fixed
version, the buffer size is set to 100 (SIZE=100).

The Nested Monitor program is a non-deterministic implementation of a bounded 
buffer that uses semaphores instead of Java condition-based synchronization. 
It may deadlock because of nested monitor calls, depending on the 
thread ordering executed by the scheduler. A fixed version of the program that
does not use synchronized get() and put() methods is included. 

This version of Nested Monitor is based on the version of Nested Monitor in the
book, "Concurrency: State Models & Java Programs" by Jeff Magee & Jeff Kramer.
