amip.api.highlevel.util
Class Semaphore

java.lang.Object
  extended by amip.api.highlevel.util.Semaphore

public class Semaphore
extends java.lang.Object


Constructor Summary
Semaphore()
           
Semaphore(int i)
           
 
Method Summary
 void acquire()
          Decrements internal counter, blocking if the counter is already zero.
 void release()
          Increments internal counter, possibly awakening a thread wait()ing in acquire().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore

public Semaphore()

Semaphore

public Semaphore(int i)
Method Detail

release

public void release()
Increments internal counter, possibly awakening a thread wait()ing in acquire().


acquire

public void acquire()
             throws java.lang.InterruptedException
Decrements internal counter, blocking if the counter is already zero.

Throws:
java.lang.InterruptedException - passed from this.wait().