public class ReadPrefReadWriteLockManager extends AbstractReadWriteLockManager
Constructor and Description |
---|
ReadPrefReadWriteLockManager()
Creates a MultiReadSingleWriteLockManager.
|
ReadPrefReadWriteLockManager(boolean trackLocks)
Creates a new MultiReadSingleWriteLockManager, optionally with lock tracking enabled.
|
Modifier and Type | Method and Description |
---|---|
Lock |
getReadLock()
Gets a read lock.
|
Lock |
getWriteLock()
Gets an exclusive write lock.
|
Lock |
tryReadLock()
Gets a read lock, if available.
|
Lock |
tryWriteLock()
Gets an exclusive write lock, if available.
|
createReadLock, createWriteLock, isReaderActive, isWriterActive, waitForActiveReaders, waitForActiveWriter
public ReadPrefReadWriteLockManager()
public ReadPrefReadWriteLockManager(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.public Lock tryReadLock()
public Lock getReadLock() throws InterruptedException
InterruptedException
- In case the thread requesting the lock was interrupted
.public Lock tryWriteLock()
public Lock getWriteLock() throws InterruptedException
InterruptedException
- In case the thread requesting the lock was interrupted
.Copyright © 2015-2020 Eclipse Foundation. All Rights Reserved.