Class SerReentrantLock
java.lang.Object
com.pnfsoftware.jeb.util.serialization.objects.SerReentrantLock
- All Implemented Interfaces:
Lock
Wrapper for a Java
ReentrantLock
that supports serialization
.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()
int
final int
int
getWaitQueueLength
(Condition condition) final boolean
hasQueuedThread
(Thread thread) final boolean
boolean
hasWaiters
(Condition condition) final boolean
isFair()
boolean
boolean
isLocked()
void
lock()
void
boolean
tryLock()
boolean
void
unlock()
-
Constructor Details
-
SerReentrantLock
public SerReentrantLock() -
SerReentrantLock
public SerReentrantLock(boolean fair)
-
-
Method Details
-
get
-
lock
public void lock() -
unlock
public void unlock() -
isHeldByCurrentThread
public boolean isHeldByCurrentThread() -
lockInterruptibly
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock() -
tryLock
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
newCondition
- Specified by:
newCondition
in interfaceLock
-
getHoldCount
public int getHoldCount() -
isLocked
public boolean isLocked() -
isFair
public final boolean isFair() -
hasQueuedThreads
public final boolean hasQueuedThreads() -
hasQueuedThread
-
getQueueLength
public final int getQueueLength() -
hasWaiters
-
getWaitQueueLength
-