Package ch.tocco.nice2.toolbox.api
Class LockPool.Lock
java.lang.Object
ch.tocco.nice2.toolbox.api.LockPool.Lock
- All Implemented Interfaces:
Lock
A shared keyed lock. Delegates all methods to an instance of
ReentrantLock.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionintintintgetWaitQueueLength(Condition condition) booleanhasQueuedThread(Thread thread) booleanbooleanhasWaiters(Condition condition) booleanisFair()booleanbooleanisLocked()voidlock()voidtoString()booleantryLock()booleanvoidunlock()
-
Method Details
-
lock
public void lock() -
lockInterruptibly
- Specified by:
lockInterruptiblyin interfaceLock- Throws:
InterruptedException- See Also:
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLockin interfaceLock- Throws:
InterruptedException- See Also:
-
unlock
public void unlock() -
newCondition
- Specified by:
newConditionin interfaceLock- See Also:
-
getQueueLength
public int getQueueLength()- See Also:
-
hasQueuedThreads
public boolean hasQueuedThreads()- See Also:
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()- See Also:
-
getWaitQueueLength
- See Also:
-
getHoldCount
public int getHoldCount()- See Also:
-
isLocked
public boolean isLocked()- See Also:
-
hasQueuedThread
- See Also:
-
isFair
public boolean isFair()- See Also:
-
hasWaiters
- See Also:
-
toString
-