EDU.oswego.cs.dl.util.concurrent
Class FIFOReadWriteLock

java.lang.Object
  |
  +--EDU.oswego.cs.dl.util.concurrent.FIFOReadWriteLock
All Implemented Interfaces:
ReadWriteLock

public class FIFOReadWriteLock
extends java.lang.Object
implements ReadWriteLock

This class implements a policy for reader/writer locks in which threads contend in a First-in/First-out manner for access (modulo the limitations of FIFOSemaphore, which is used for queuing). This policy does not particularly favor readers or writers. As a byproduct of the FIFO policy, the attempt methods may return false even when the lock might logically be available, but, due to contention, cannot be accessed within the given time bound.

This lock is NOT>/em> reentrant. Current readers and writers should not try to re-obtain locks while holding them.

[ Introduction to this package. ]

See Also:
FIFOSemaphore

Constructor Summary
FIFOReadWriteLock()
           
 
Method Summary
 Sync readLock()
          get the readLock
 Sync writeLock()
          get the writeLock
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FIFOReadWriteLock

public FIFOReadWriteLock()
Method Detail

writeLock

public Sync writeLock()
Description copied from interface: ReadWriteLock
get the writeLock

Specified by:
writeLock in interface ReadWriteLock

readLock

public Sync readLock()
Description copied from interface: ReadWriteLock
get the readLock

Specified by:
readLock in interface ReadWriteLock