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
FIFOReadWriteLock
public FIFOReadWriteLock()
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
Submit a bug or feature. Check the Colt home page for the latest news.