Class CycleDetectingLockFactory.CycleDetectingReentrantLock
java.lang.Object
java.util.concurrent.locks.ReentrantLock
com.google.common.util.concurrent.CycleDetectingLockFactory.CycleDetectingReentrantLock
- All Implemented Interfaces:
CycleDetectingLockFactory.CycleDetectingLock,Serializable,Lock
- Enclosing class:
CycleDetectingLockFactory
final class CycleDetectingLockFactory.CycleDetectingReentrantLock
extends ReentrantLock
implements CycleDetectingLockFactory.CycleDetectingLock
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateCycleDetectingReentrantLock(CycleDetectingLockFactory.LockGraphNode lockGraphNode, boolean fair) -
Method Summary
Methods inherited from class java.util.concurrent.locks.ReentrantLock
getHoldCount, getOwner, getQueuedThreads, getQueueLength, getWaitingThreads, getWaitQueueLength, hasQueuedThread, hasQueuedThreads, hasWaiters, isFair, isHeldByCurrentThread, isLocked, newCondition, toString
-
Field Details
-
lockGraphNode
-
-
Constructor Details
-
CycleDetectingReentrantLock
private CycleDetectingReentrantLock(CycleDetectingLockFactory.LockGraphNode lockGraphNode, boolean fair)
-
-
Method Details
-
getLockGraphNode
- Specified by:
getLockGraphNodein interfaceCycleDetectingLockFactory.CycleDetectingLock- Returns:
- the
CycleDetectingLockFactory.LockGraphNodeassociated with this lock.
-
isAcquiredByCurrentThread
public boolean isAcquiredByCurrentThread()- Specified by:
isAcquiredByCurrentThreadin interfaceCycleDetectingLockFactory.CycleDetectingLock- Returns:
trueif the current thread has acquired this lock.
-
lock
public void lock()- Specified by:
lockin interfaceLock- Overrides:
lockin classReentrantLock
-
lockInterruptibly
- Specified by:
lockInterruptiblyin interfaceLock- Overrides:
lockInterruptiblyin classReentrantLock- Throws:
InterruptedException
-
tryLock
public boolean tryLock()- Specified by:
tryLockin interfaceLock- Overrides:
tryLockin classReentrantLock
-
tryLock
- Specified by:
tryLockin interfaceLock- Overrides:
tryLockin classReentrantLock- Throws:
InterruptedException
-
unlock
public void unlock()- Specified by:
unlockin interfaceLock- Overrides:
unlockin classReentrantLock
-