org.compass.core.util.backport.java.util.concurrent
Class Semaphore.FairSync
java.lang.Object
org.compass.core.util.backport.java.util.concurrent.Semaphore.Sync
org.compass.core.util.backport.java.util.concurrent.Semaphore.FairSync
- All Implemented Interfaces:
- Serializable, WaitQueue.QueuedSync
- Enclosing class:
- Semaphore
static final class Semaphore.FairSync
- extends Semaphore.Sync
- implements WaitQueue.QueuedSync
Fair version
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Semaphore.FairSync
Semaphore.FairSync(int initialPermits)
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
precheck
protected boolean precheck(int n)
recheck
public boolean recheck(WaitQueue.WaitNode w)
- Specified by:
recheck in interface WaitQueue.QueuedSync
takeOver
public void takeOver(WaitQueue.WaitNode n)
- Specified by:
takeOver in interface WaitQueue.QueuedSync
getSignallee
protected Semaphore.FairSync.Node getSignallee(int n)
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.