org.compass.core.util.backport.java.util.concurrent
Class Semaphore.NonfairSync

java.lang.Object
  extended by org.compass.core.util.backport.java.util.concurrent.Semaphore.Sync
      extended by org.compass.core.util.backport.java.util.concurrent.Semaphore.NonfairSync
All Implemented Interfaces:
Serializable
Enclosing class:
Semaphore

static final class Semaphore.NonfairSync
extends Semaphore.Sync

Nonfair version


Field Summary
 
Fields inherited from class org.compass.core.util.backport.java.util.concurrent.Semaphore.Sync
permits_
 
Constructor Summary
protected Semaphore.NonfairSync(int initialPermits)
           
 
Method Summary
 void acquire(int n)
           
 void acquireUninterruptibly(int n)
           
 boolean attempt(int n, long nanos)
           
 Collection getQueuedThreads()
           
 int getQueueLength()
           
 boolean hasQueuedThreads()
           
 void release(int n)
           
 
Methods inherited from class org.compass.core.util.backport.java.util.concurrent.Semaphore.Sync
attempt, drain, getPermits, reduce
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Semaphore.NonfairSync

protected Semaphore.NonfairSync(int initialPermits)
Method Detail

acquireUninterruptibly

public void acquireUninterruptibly(int n)
Specified by:
acquireUninterruptibly in class Semaphore.Sync

acquire

public void acquire(int n)
             throws InterruptedException
Specified by:
acquire in class Semaphore.Sync
Throws:
InterruptedException

attempt

public boolean attempt(int n,
                       long nanos)
                throws InterruptedException
Specified by:
attempt in class Semaphore.Sync
Throws:
InterruptedException

release

public void release(int n)
Specified by:
release in class Semaphore.Sync

hasQueuedThreads

public boolean hasQueuedThreads()
Specified by:
hasQueuedThreads in class Semaphore.Sync

getQueueLength

public int getQueueLength()
Specified by:
getQueueLength in class Semaphore.Sync

getQueuedThreads

public Collection getQueuedThreads()
Specified by:
getQueuedThreads in class Semaphore.Sync


Copyright (c) 2004-2006 The Compass Project.