Package one.nio.lock
Class RWLock
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
FairRWLock,PaddedRWLock
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidfinal RWLocklockRead()final booleanlockRead(long timeout) final RWLockfinal booleanlockWrite(long timeout) protected inttryAcquireShared(int acquires) protected final booleantryReleaseShared(int releases) final voidunlock(boolean write) final voidfinal voidMethods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isHeldExclusively, isQueued, owns, release, releaseShared, setState, toString, tryAcquire, tryAcquireNanos, tryAcquireSharedNanos, tryReleaseMethods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
Constructor Details
-
RWLock
public RWLock()
-
-
Method Details
-
lockRead
-
lockRead
public final boolean lockRead(long timeout) -
unlockRead
public final void unlockRead() -
lockWrite
-
lockWrite
public final boolean lockWrite(long timeout) -
unlockWrite
public final void unlockWrite() -
unlock
public final void unlock(boolean write) -
downgrade
public final void downgrade()
-