net.ponder2
Class Semaphore

java.lang.Object
  extended by net.ponder2.Semaphore
All Implemented Interfaces:
ManagedObject

public class Semaphore
extends java.lang.Object
implements ManagedObject

A semaphore object to enable synchronisation between managed objects. Typically used when interacting with GUIs

Version:
$Id:$
Author:
Kevin Twidle

Method Summary
protected  void acquire()
          Tries to acquire a permit.
protected  void release()
          Releases the semaphore ay incrementing the number of permits available.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

acquire

protected void acquire()
Tries to acquire a permit. If none are available then the task will hang until one becomes available


release

protected void release()
Releases the semaphore ay incrementing the number of permits available. If a task is blocked on this semaphore then that task is released instead of increasing the number of permits.



Copyright © 2008 Imperial College. All Rights Reserved.