edu.oswego.cs.dl.util.concurrent
Class WriterPreferenceReadWriteLock
java.lang.Object
|
+--edu.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock
- All Implemented Interfaces:
- ReadWriteLock
- Direct Known Subclasses:
- ReaderPreferenceReadWriteLock, ReentrantWriterPreferenceReadWriteLock
- public class WriterPreferenceReadWriteLock
- extends Object
- implements ReadWriteLock
A ReadWriteLock that prefers waiting writers over
waiting readers when there is contention. This class
is adapted from the versions described in CPJ, improving
on the ones there a bit by segregating reader and writer
wait queues, which is typically more efficient.
The locks are NOT reentrant. In particular,
even though it may appear to usually work OK,
a thread holding a read lock should not attempt to
re-acquire it. Doing so risks lockouts when there are
also waiting writers.
[ Introduction to this package. ]
WriterPreferenceReadWriteLock
public WriterPreferenceReadWriteLock()
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.