Class Deadlock

  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:

Field Summary
static Semaphore iAmDone
          Semaphore to signal that the bowing is over.
Constructor Summary
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


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

Constructor Detail


public Deadlock()
Method Detail


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