DeadlockExample -- deliberately trying to
create a deadlock (and succeeding eventually).
To see this example in action:
Compile the Java source file, DeadlockExample.java:
javac DeadlockExample.java
Run the class:
java DeadlockExample
When the threads no longer seem to be making progress, trigger
a thread-and-monitor dump (by pressing ctrl-break in Win32,
ctrl-\ in Solaris) and check for the characteristic deadlock
pattern.