Class Deadlock

java.lang.Object
  extended by Deadlock

public class Deadlock
extends Object

Alphonse bows to Gaston and Gaston bows to Alphonse. As bowBack() is a synchronized method, both wait for the other to bow back. This is an adaptation of the example in the Java Tutorial.

See Also:
http://java.sun.com/docs/books/tutorial/essential/concurrency/deadlock.html

Field Summary
static Semaphore iAmDone
          Semaphore to signal that the bowing is over.
 
Constructor Summary
Deadlock()
           
 
Method Summary
static void main(String[] args)
          Main program.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iAmDone

public static Semaphore iAmDone
Semaphore to signal that the bowing is over.

Constructor Detail

Deadlock

public Deadlock()
Method Detail

main

public static void main(String[] args)
Main program.