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 int
getHoldCount()
java.lang.Thread
getOwner()
protected java.util.Collection<java.lang.Thread>
getQueuedThreads()
int
getQueueLength()
protected java.util.Collection<java.lang.Thread>
getWaitingThreads(java.util.concurrent.locks.Condition condition)
int
getWaitQueueLength(java.util.concurrent.locks.Condition condition)
boolean
hasQueuedThread(java.lang.Thread thread)
boolean
hasQueuedThreads()
boolean
hasWaiters(java.util.concurrent.locks.Condition condition)
boolean
isHeldByCurrentThread()
boolean
isLocked()
protected boolean
isOwner(java.lang.Thread thread, java.lang.Thread owner)
void
lock()
void
lockInterruptibly()
java.util.concurrent.locks.Condition
newCondition()
java.lang.String
toString()
boolean
tryLock()
boolean
tryLock(long timeout, java.util.concurrent.TimeUnit unit)
void
unlock()
-
-
-
Method Detail
-
lock
public void lock()
- Specified by:
lock
in interfacejava.util.concurrent.locks.Lock
-
lockInterruptibly
public void lockInterruptibly() throws java.lang.InterruptedException
- Specified by:
lockInterruptibly
in interfacejava.util.concurrent.locks.Lock
- Throws:
java.lang.InterruptedException
-
tryLock
public boolean tryLock()
- Specified by:
tryLock
in interfacejava.util.concurrent.locks.Lock
-
tryLock
public boolean tryLock(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
tryLock
in interfacejava.util.concurrent.locks.Lock
- Throws:
java.lang.InterruptedException
-
unlock
public void unlock()
- Specified by:
unlock
in interfacejava.util.concurrent.locks.Lock
-
newCondition
public java.util.concurrent.locks.Condition newCondition()
- Specified by:
newCondition
in 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:
toString
in 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)
-
-