Package org.apache.juneau.internal
Class SimpleReadWriteLock
java.lang.Object
java.util.concurrent.locks.ReentrantReadWriteLock
org.apache.juneau.internal.SimpleReadWriteLock
- All Implemented Interfaces:
Serializable
,ReadWriteLock
An extension of
ReentrantReadWriteLock
with convenience methods for creating
auto-closeable locks.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
ReentrantReadWriteLock.ReadLock, ReentrantReadWriteLock.WriteLock
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.util.concurrent.locks.ReentrantReadWriteLock
getOwner, getQueuedReaderThreads, getQueuedThreads, getQueuedWriterThreads, getQueueLength, getReadHoldCount, getReadLockCount, getWaitingThreads, getWaitQueueLength, getWriteHoldCount, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isWriteLocked, isWriteLockedByCurrentThread, readLock, toString, writeLock
-
Field Details
-
NO_OP
A no-op lock.
-
-
Constructor Details
-
SimpleReadWriteLock
public SimpleReadWriteLock()Constructor. -
SimpleReadWriteLock
Constructor- Parameters:
fair
-true if this lock should use a fair ordering policy.
-
-
Method Details
-
write
Construct a write lock.- Returns:
- A new closeable write lock.
-
read
Construct a read lock.- Returns:
- A new closeable read lock.
-