Colt 1.0.2

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 Object
implements ReadWriteLock

This class implements a policy for reader/writer locks in which incoming readers and writers contend in generally fair manner for entry. When one reader enters, all others may enter. When the last reader exits a waiting writer may enter. This does not provide globally FIFO behavior since readers arriving after a writer may join other readers (in the style of a Reader's preference RW lock). But it does ensure FIFO ordering across writers, so earlier writers will write first, modulo the caveats discussed with FIFOSemaphore, which is used for queuing.

[ 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

readLock

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

writeLock

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

Colt 1.0.2

Submit a bug or feature. Check the Colt home page for the latest news.