org.compass.core.util.backport.java.util.concurrent.locks
Class ReentrantLock.Sync
java.lang.Object
org.compass.core.util.backport.java.util.concurrent.locks.ReentrantLock.Sync
- All Implemented Interfaces:
- Serializable
- Direct Known Subclasses:
- ReentrantLock.FairSync, ReentrantLock.NonfairSync
- Enclosing class:
- ReentrantLock
abstract static class ReentrantLock.Sync
- extends Object
- implements Serializable
Base of synchronization control for this lock. Subclassed
into fair and nonfair versions below.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
owner_
protected transient Thread owner_
holds_
protected transient int holds_
ReentrantLock.Sync
protected ReentrantLock.Sync()
lock
public abstract void lock()
- Performs
Lock.lock(). The main reason for subclassing
is to allow fast path for nonfair version.
lockInterruptibly
public abstract void lockInterruptibly()
throws InterruptedException
- Throws:
InterruptedException
incHolds
final void incHolds()
tryLock
public boolean tryLock()
tryLock
public abstract boolean tryLock(long nanos)
throws InterruptedException
- Throws:
InterruptedException
unlock
public abstract void unlock()
getHoldCount
public int getHoldCount()
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
isLocked
public boolean isLocked()
isFair
public abstract boolean isFair()
getOwner
protected Thread getOwner()
hasQueuedThreads
public boolean hasQueuedThreads()
getQueueLength
public int getQueueLength()
getQueuedThreads
public Collection getQueuedThreads()
isQueued
public boolean isQueued(Thread thread)
Copyright (c) 2004-2006 The Compass Project.