Main Page   Packages   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members  

Connector.java

00001 final class Connector 
00002 {
00003      int queue;
00004      
00005      public Connector()
00006      {
00007           this.queue = -1;
00008      }
00009      
00010      public final synchronized void add (int o)
00011      {
00012           this.queue = o;
00013           this.notifyAll();
00014      }
00015      
00016      public final synchronized void stop ()
00017      {
00018           this.queue = 0;
00019           this.notifyAll();
00020      }
00021      
00022      public final synchronized int take ()
00023      {
00024           int value;
00025           while (this.queue < 0)
00026           {
00027                try {
00028                     this.wait();
00029                }
00030                catch (java.lang.InterruptedException ex) {
00031                }
00032           }
00033           value = this.queue;
00034           this.queue = -1;
00035           return value;
00036      }
00037 }

Generated at Thu Feb 7 06:42:48 2002 for Bandera by doxygen1.2.10 written by Dimitri van Heesch, © 1997-2001