public class WritePrefReadWriteLockManager extends AbstractReadWriteLockManager
Constructor and Description |
---|
WritePrefReadWriteLockManager()
Creates a MultiReadSingleWriteLockManager.
|
WritePrefReadWriteLockManager(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 WritePrefReadWriteLockManager()
public WritePrefReadWriteLockManager(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-2019 Eclipse Foundation. All Rights Reserved.