Class NonFairReentrantLock
- java.lang.Object
-
- org.eclipse.net4j.util.concurrent.NonFairReentrantLock
-
- All Implemented Interfaces:
java.io.Serializable,java.util.concurrent.locks.Lock
- Direct Known Subclasses:
DelegableReentrantLock
public class NonFairReentrantLock extends java.lang.Object implements java.util.concurrent.locks.Lock, java.io.Serializable- Since:
- 3.6
- Author:
- Eike Stepper
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NonFairReentrantLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetHoldCount()java.lang.ThreadgetOwner()protected java.util.Collection<java.lang.Thread>getQueuedThreads()intgetQueueLength()protected java.util.Collection<java.lang.Thread>getWaitingThreads(java.util.concurrent.locks.Condition condition)intgetWaitQueueLength(java.util.concurrent.locks.Condition condition)booleanhasQueuedThread(java.lang.Thread thread)booleanhasQueuedThreads()booleanhasWaiters(java.util.concurrent.locks.Condition condition)booleanisHeldByCurrentThread()booleanisLocked()protected booleanisOwner(java.lang.Thread thread, java.lang.Thread owner)voidlock()voidlockInterruptibly()java.util.concurrent.locks.ConditionnewCondition()java.lang.StringtoString()booleantryLock()booleantryLock(long timeout, java.util.concurrent.TimeUnit unit)voidunlock()
-
-
-
Method Detail
-
lock
public void lock()
- Specified by:
lockin interfacejava.util.concurrent.locks.Lock
-
lockInterruptibly
public void lockInterruptibly() throws java.lang.InterruptedException- Specified by:
lockInterruptiblyin interfacejava.util.concurrent.locks.Lock- Throws:
java.lang.InterruptedException
-
tryLock
public boolean tryLock()
- Specified by:
tryLockin interfacejava.util.concurrent.locks.Lock
-
tryLock
public boolean tryLock(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
tryLockin interfacejava.util.concurrent.locks.Lock- Throws:
java.lang.InterruptedException
-
unlock
public void unlock()
- Specified by:
unlockin interfacejava.util.concurrent.locks.Lock
-
newCondition
public java.util.concurrent.locks.Condition newCondition()
- Specified by:
newConditionin interfacejava.util.concurrent.locks.Lock
-
getHoldCount
public int getHoldCount()
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-
isLocked
public boolean isLocked()
-
getOwner
public java.lang.Thread getOwner()
-
hasQueuedThreads
public final boolean hasQueuedThreads()
-
hasQueuedThread
public final boolean hasQueuedThread(java.lang.Thread thread)
-
getQueueLength
public final int getQueueLength()
-
hasWaiters
public boolean hasWaiters(java.util.concurrent.locks.Condition condition)
-
getWaitQueueLength
public int getWaitQueueLength(java.util.concurrent.locks.Condition condition)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getQueuedThreads
protected java.util.Collection<java.lang.Thread> getQueuedThreads()
-
getWaitingThreads
protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition condition)
-
isOwner
protected boolean isOwner(java.lang.Thread thread, java.lang.Thread owner)
-
-