org.compass.core.util.backport.java.util.concurrent.locks
Class ReentrantLock.Sync

java.lang.Object
  extended by 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.


Field Summary
protected  int holds_
           
protected  Thread owner_
           
 
Constructor Summary
protected ReentrantLock.Sync()
           
 
Method Summary
 int getHoldCount()
           
protected  Thread getOwner()
           
 Collection getQueuedThreads()
           
 int getQueueLength()
           
 boolean hasQueuedThreads()
           
(package private)  void incHolds()
           
abstract  boolean isFair()
           
 boolean isHeldByCurrentThread()
           
 boolean isLocked()
           
 boolean isQueued(Thread thread)
           
abstract  void lock()
          Performs Lock.lock().
abstract  void lockInterruptibly()
           
 boolean tryLock()
           
abstract  boolean tryLock(long nanos)
           
abstract  void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner_

protected transient Thread owner_

holds_

protected transient int holds_
Constructor Detail

ReentrantLock.Sync

protected ReentrantLock.Sync()
Method Detail

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.