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
ConstructorsModifierConstructorDescriptionprivate
CycleDetectingReentrantLock
(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:
getLockGraphNode
in interfaceCycleDetectingLockFactory.CycleDetectingLock
- Returns:
- the
CycleDetectingLockFactory.LockGraphNode
associated with this lock.
-
isAcquiredByCurrentThread
public boolean isAcquiredByCurrentThread()- Specified by:
isAcquiredByCurrentThread
in interfaceCycleDetectingLockFactory.CycleDetectingLock
- Returns:
true
if the current thread has acquired this lock.
-
lock
public void lock()- Specified by:
lock
in interfaceLock
- Overrides:
lock
in classReentrantLock
-
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Overrides:
lockInterruptibly
in classReentrantLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock()- Specified by:
tryLock
in interfaceLock
- Overrides:
tryLock
in classReentrantLock
-
tryLock
- Specified by:
tryLock
in interfaceLock
- Overrides:
tryLock
in classReentrantLock
- Throws:
InterruptedException
-
unlock
public void unlock()- Specified by:
unlock
in interfaceLock
- Overrides:
unlock
in classReentrantLock
-