public class EnhancedRWLock
extends java.util.concurrent.locks.ReentrantReadWriteLock
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
Constructor and Description |
---|
EnhancedRWLock() |
EnhancedRWLock(boolean fair) |
Modifier and Type | Method and Description |
---|---|
void |
withReadLock(groovy.lang.Closure cl)
Performs the passed-in closure with the read lock locked and unlocks the read lock automatically
after the closure finishes.
|
void |
withWriteLock(groovy.lang.Closure cl)
Performs the passed-in closure with the write lock locked and unlocks the write lock automatically
after the closure finishes.
|
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock
private static final long serialVersionUID
public EnhancedRWLock()
public EnhancedRWLock(boolean fair)
public void withReadLock(groovy.lang.Closure cl)
cl
- The closure to perform with the read lock heldpublic void withWriteLock(groovy.lang.Closure cl)
cl
- The closure to perform with the write lock held