public class NonFairReentrantLock extends Object implements Lock, Serializable
Constructor and Description |
---|
NonFairReentrantLock() |
Modifier and Type | Method and Description |
---|---|
int |
getHoldCount() |
Thread |
getOwner() |
protected Collection<Thread> |
getQueuedThreads() |
int |
getQueueLength() |
protected Collection<Thread> |
getWaitingThreads(Condition condition) |
int |
getWaitQueueLength(Condition condition) |
boolean |
hasQueuedThread(Thread thread) |
boolean |
hasQueuedThreads() |
boolean |
hasWaiters(Condition condition) |
boolean |
isHeldByCurrentThread() |
boolean |
isLocked() |
protected boolean |
isOwner(Thread thread,
Thread owner) |
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
String |
toString() |
boolean |
tryLock() |
boolean |
tryLock(long timeout,
TimeUnit unit) |
void |
unlock() |
public void lockInterruptibly() throws InterruptedException
lockInterruptibly
in interface Lock
InterruptedException
public boolean tryLock(long timeout, TimeUnit unit) throws InterruptedException
tryLock
in interface Lock
InterruptedException
public Condition newCondition()
newCondition
in interface Lock
public int getHoldCount()
public boolean isHeldByCurrentThread()
public boolean isLocked()
public Thread getOwner()
public final boolean hasQueuedThreads()
public final boolean hasQueuedThread(Thread thread)
public final int getQueueLength()
public boolean hasWaiters(Condition condition)
public int getWaitQueueLength(Condition condition)
protected Collection<Thread> getQueuedThreads()
protected Collection<Thread> getWaitingThreads(Condition condition)
Copyright (c) 2011-2015 Eike Stepper (Berlin, Germany) and others.