
Public Member Functions | |
| Sync | writeLock () |
| Sync | readLock () |
Protected Member Functions | |
| synchronized void | cancelledWaitingReader () |
| synchronized void | cancelledWaitingWriter () |
| boolean | allowReader () |
| synchronized boolean | startRead () |
| synchronized boolean | startWrite () |
| synchronized boolean | startReadFromNewReader () |
| synchronized boolean | startWriteFromNewWriter () |
| synchronized boolean | startReadFromWaitingReader () |
| synchronized boolean | startWriteFromWaitingWriter () |
| synchronized Signaller | endRead () |
| synchronized Signaller | endWrite () |
Protected Attributes | |
| long | activeReaders_ = 0 |
| Thread | activeWriter_ = null |
| long | waitingReaders_ = 0 |
| long | waitingWriters_ = 0 |
| final ReaderLock | readerLock_ = new ReaderLock() |
| final WriterLock | writerLock_ = new WriterLock() |
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. ]
|
|
|
|
|
|
|
|
|
|
|
Called upon termination of a read. Returns the object to signal to wake up a waiter, or null if no such |
|
|
Called upon termination of a write. Returns the object to signal to wake up a waiter, or null if no such |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1.3.8