API Overview API Index Package Overview Direct link to this page
JDK 1.6
  java.util.concurrent.locks. ReentrantReadWriteLock View Source
Author(s)
Doug Lea
Since
1.5
Version
Serial
Hierarchy
 Object
      ReentrantReadWriteLock
Implements
 ReadWriteLock
 Serializable
Subclasses
Description
public class ReentrantReadWriteLock
  An implementation of ReadWriteLock supporting similar semantics to ReentrantLock.
See also:   
Constructors
public ReentrantReadWriteLock ()
Creates a new ReentrantReadWriteLock with default (nonfair) ordering properties.
public ReentrantReadWriteLock (boolean fair)
  Creates a new ReentrantReadWriteLock with the given fairness policy.
Methods
Hide/Show inherited methods
protected Thread getOwner ()
  Returns the thread that currently owns the write lock, or null if not owned.
protected Collection<Thread> getQueuedReaderThreads ()
  Returns a collection containing threads that may be waiting to acquire the read lock.
protected Collection<Thread> getQueuedThreads ()
  Returns a collection containing threads that may be waiting to acquire either the read or write lock.
protected Collection<Thread> getQueuedWriterThreads ()
  Returns a collection containing threads that may be waiting to acquire the write lock.
publicfinal int getQueueLength ()
  Returns an estimate of the number of threads waiting to acquire either the read or write lock.
public int getReadHoldCount ()
  Queries the number of reentrant read holds on this lock by the current thread.
public int getReadLockCount ()
  Queries the number of read locks held for this lock.
protected Collection<Thread> getWaitingThreads (Condition condition)
  Returns a collection containing those threads that may be waiting on the given condition associated with the write lock.
public int getWaitQueueLength (Condition condition)
  Returns an estimate of the number of threads waiting on the given condition associated with the write lock.
public int getWriteHoldCount ()
  Queries the number of reentrant write holds on this lock by the current thread.
publicfinal boolean hasQueuedThread (Thread thread)
  Queries whether the given thread is waiting to acquire either the read or write lock.
publicfinal boolean hasQueuedThreads ()
  Queries whether any threads are waiting to acquire the read or write lock.
public boolean hasWaiters (Condition condition)
  Queries whether any threads are waiting on the given condition associated with the write lock.
publicfinal boolean isFair ()
  Returns true if this lock has fairness set true.
public boolean isWriteLocked ()
  Queries if the write lock is held by any thread.
public boolean isWriteLockedByCurrentThread ()
  Queries if the write lock is held by the current thread.
public ReadLock readLock () [Specified in ReadWriteLock]
public String toString ()
  Returns a string identifying this lock, as well as its lock state.
public WriteLock writeLock () [Specified in ReadWriteLock]
Fields
Hide/Show inherited fields
Nested Classes
  ReentrantReadWriteLock.Sync
Synchronization implementation for ReentrantReadWriteLock.
  ReentrantReadWriteLock.NonfairSync
Nonfair version of Sync
  ReentrantReadWriteLock.FairSync
Fair version of Sync
  ReentrantReadWriteLock.ReadLock
The lock returned by method ReentrantReadWriteLock.readLock().
  ReentrantReadWriteLock.WriteLock
The lock returned by method ReentrantReadWriteLock.writeLock().
Generated By: JavaOnTracks Doclet 0.1.4     ©Thibaut Colar