public class NonFairReentrantLock
extends java.lang.Object
implements java.util.concurrent.locks.Lock, java.io.Serializable
Constructor and Description |
---|
NonFairReentrantLock() |
Modifier and Type | Method and 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() |
public void lock()
lock
in interface java.util.concurrent.locks.Lock
public void lockInterruptibly() throws java.lang.InterruptedException
lockInterruptibly
in interface java.util.concurrent.locks.Lock
java.lang.InterruptedException
public boolean tryLock()
tryLock
in interface java.util.concurrent.locks.Lock
public boolean tryLock(long timeout, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
tryLock
in interface java.util.concurrent.locks.Lock
java.lang.InterruptedException
public void unlock()
unlock
in interface java.util.concurrent.locks.Lock
public java.util.concurrent.locks.Condition newCondition()
newCondition
in interface java.util.concurrent.locks.Lock
public int getHoldCount()
public boolean isHeldByCurrentThread()
public boolean isLocked()
public java.lang.Thread getOwner()
public final boolean hasQueuedThreads()
public final boolean hasQueuedThread(java.lang.Thread thread)
public final int getQueueLength()
public boolean hasWaiters(java.util.concurrent.locks.Condition condition)
public int getWaitQueueLength(java.util.concurrent.locks.Condition condition)
public java.lang.String toString()
toString
in class java.lang.Object
protected java.util.Collection<java.lang.Thread> getQueuedThreads()
protected java.util.Collection<java.lang.Thread> getWaitingThreads(java.util.concurrent.locks.Condition condition)
protected boolean isOwner(java.lang.Thread thread, java.lang.Thread owner)
Copyright (c) 2004-2019 Eike Stepper (Loehne, 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