public final class NonReentrantLock
extends java.util.concurrent.locks.AbstractQueuedSynchronizer
implements java.util.concurrent.locks.Lock
| Modifier and Type | Field and Description |
|---|---|
private java.lang.Thread |
owner |
private static long |
serialVersionUID |
| Constructor and Description |
|---|
NonReentrantLock() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isHeldByCurrentThread() |
protected boolean |
isHeldExclusively() |
void |
lock() |
void |
lockInterruptibly() |
java.util.concurrent.locks.Condition |
newCondition() |
protected boolean |
tryAcquire(int acquires) |
boolean |
tryLock() |
boolean |
tryLock(long time,
java.util.concurrent.TimeUnit unit) |
protected boolean |
tryRelease(int releases) |
void |
unlock() |
acquire, acquireInterruptibly, acquireShared, acquireSharedInterruptibly, compareAndSetState, getExclusiveQueuedThreads, getFirstQueuedThread, getQueuedThreads, getQueueLength, getSharedQueuedThreads, getState, getWaitingThreads, getWaitQueueLength, hasContended, hasQueuedPredecessors, hasQueuedThreads, hasWaiters, isQueued, owns, release, releaseShared, setState, toString, tryAcquireNanos, tryAcquireShared, tryAcquireSharedNanos, tryReleaseSharedprivate static final long serialVersionUID
private java.lang.Thread owner
public void lock()
lock in interface java.util.concurrent.locks.Lockpublic void lockInterruptibly()
throws java.lang.InterruptedException
lockInterruptibly in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic boolean tryLock()
tryLock in interface java.util.concurrent.locks.Lockpublic boolean tryLock(long time,
java.util.concurrent.TimeUnit unit)
throws java.lang.InterruptedException
tryLock in interface java.util.concurrent.locks.Lockjava.lang.InterruptedExceptionpublic void unlock()
unlock in interface java.util.concurrent.locks.Lockpublic boolean isHeldByCurrentThread()
public java.util.concurrent.locks.Condition newCondition()
newCondition in interface java.util.concurrent.locks.Lockprotected boolean tryAcquire(int acquires)
tryAcquire in class java.util.concurrent.locks.AbstractQueuedSynchronizerprotected boolean tryRelease(int releases)
tryRelease in class java.util.concurrent.locks.AbstractQueuedSynchronizerprotected boolean isHeldExclusively()
isHeldExclusively in class java.util.concurrent.locks.AbstractQueuedSynchronizer