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 LockInterruptedExceptionpublic boolean tryLock(long timeout,
TimeUnit unit)
throws InterruptedException
tryLock in interface LockInterruptedExceptionpublic Condition newCondition()
newCondition in interface Lockpublic 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) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html