|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--EDU.oswego.cs.dl.util.concurrent.WriterPreferenceReadWriteLock
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. ]
| Constructor Summary | |
WriterPreferenceReadWriteLock()
|
|
| 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 |
public WriterPreferenceReadWriteLock()
| Method Detail |
public Sync writeLock()
ReadWriteLock
writeLock in interface ReadWriteLockpublic Sync readLock()
ReadWriteLock
readLock in interface ReadWriteLock
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||