org.gudy.azureus2.pluginsimpl.local.utils
Class SemaphoreImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.utils.SemaphoreImpl
All Implemented Interfaces:
Semaphore

public class SemaphoreImpl
extends Object
implements Semaphore


Constructor Summary
protected SemaphoreImpl(PluginInterface pi)
           
 
Method Summary
 void release()
           
 void releaseAllWaiters()
           
 void reserve()
           
 boolean reserve(long timeout_millis)
          reserve a semaphore subject to timeout
 boolean reserveIfAvailable()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemaphoreImpl

protected SemaphoreImpl(PluginInterface pi)
Method Detail

reserve

public void reserve()
Specified by:
reserve in interface Semaphore

reserveIfAvailable

public boolean reserveIfAvailable()
Specified by:
reserveIfAvailable in interface Semaphore

reserve

public boolean reserve(long timeout_millis)
Description copied from interface: Semaphore
reserve a semaphore subject to timeout

Specified by:
reserve in interface Semaphore
Parameters:
timeout_millis - time to wait
Returns:
true -> semaphore reserved, false -> timeout exceeded

release

public void release()
Specified by:
release in interface Semaphore

releaseAllWaiters

public void releaseAllWaiters()
Specified by:
releaseAllWaiters in interface Semaphore