public abstract class AbstractReadWriteLockManager extends Object implements ReadWriteLockManager
Constructor and Description |
---|
AbstractReadWriteLockManager()
Creates a MultiReadSingleWriteLockManager.
|
AbstractReadWriteLockManager(boolean trackLocks)
Creates a new MultiReadSingleWriteLockManager, optionally with lock tracking enabled.
|
Modifier and Type | Method and Description |
---|---|
protected Lock |
createReadLock()
Creates a new Lock for reading and increments counter for active readers.
|
protected Lock |
createWriteLock()
Creates a new Lock for writing.
|
protected boolean |
isReaderActive()
If one or more readers are active
|
protected boolean |
isWriterActive()
If a writer is active
|
protected void |
waitForActiveReaders()
Blocks current thread until there are no reader locks active.
|
protected void |
waitForActiveWriter()
Blocks current thread until after the writer lock is released (if active).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getReadLock, getWriteLock, tryReadLock, tryWriteLock
public AbstractReadWriteLockManager()
public AbstractReadWriteLockManager(boolean trackLocks)
trackLocks
- Controls whether the lock manager will keep track of active locks. Enabling lock tracking will
add some overhead, but can be very useful for debugging.protected boolean isWriterActive()
protected boolean isReaderActive()
protected void waitForActiveWriter() throws InterruptedException
InterruptedException
protected void waitForActiveReaders() throws InterruptedException
InterruptedException
protected Lock createReadLock()
protected Lock createWriteLock()
Copyright © 2015-2022 Eclipse Foundation. All Rights Reserved.