org.compass.core.util.backport.java.util.concurrent.locks
Class ReentrantLock.FairSync
java.lang.Object
org.compass.core.util.backport.java.util.concurrent.locks.ReentrantLock.Sync
org.compass.core.util.backport.java.util.concurrent.locks.ReentrantLock.FairSync
- All Implemented Interfaces:
- Serializable, WaitQueue.QueuedSync
- Enclosing class:
- ReentrantLock
static final class ReentrantLock.FairSync
- extends ReentrantLock.Sync
- implements WaitQueue.QueuedSync
Sync object for fair locks
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReentrantLock.FairSync
ReentrantLock.FairSync()
recheck
public boolean recheck(WaitQueue.WaitNode node)
- Specified by:
recheck in interface WaitQueue.QueuedSync
takeOver
public void takeOver(WaitQueue.WaitNode node)
- Specified by:
takeOver in interface WaitQueue.QueuedSync
lock
public void lock()
- Description copied from class:
ReentrantLock.Sync
- Performs
Lock.lock(). The main reason for subclassing
is to allow fast path for nonfair version.
- Specified by:
lock in class ReentrantLock.Sync
lockInterruptibly
public void lockInterruptibly()
throws InterruptedException
- Specified by:
lockInterruptibly in class ReentrantLock.Sync
- Throws:
InterruptedException
tryLock
public boolean tryLock(long nanos)
throws InterruptedException
- Specified by:
tryLock in class ReentrantLock.Sync
- Throws:
InterruptedException
getSignallee
protected WaitQueue.WaitNode getSignallee(Thread caller)
unlock
public void unlock()
- Specified by:
unlock in class ReentrantLock.Sync
isFair
public final boolean isFair()
- Specified by:
isFair in class ReentrantLock.Sync
hasQueuedThreads
public boolean hasQueuedThreads()
- Overrides:
hasQueuedThreads in class ReentrantLock.Sync
getQueueLength
public int getQueueLength()
- Overrides:
getQueueLength in class ReentrantLock.Sync
getQueuedThreads
public Collection getQueuedThreads()
- Overrides:
getQueuedThreads in class ReentrantLock.Sync
isQueued
public boolean isQueued(Thread thread)
- Overrides:
isQueued in class ReentrantLock.Sync
Copyright (c) 2004-2006 The Compass Project.