public final class NonReentrantLock extends AbstractQueuedSynchronizer implements Lock
AbstractQueuedSynchronizer.ConditionObject| 构造器和说明 |
|---|
NonReentrantLock() |
| 限定符和类型 | 方法和说明 |
|---|---|
Thread |
getOwner() |
boolean |
isHeldByCurrentThread() |
protected boolean |
isHeldExclusively() |
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
protected boolean |
tryAcquire(int acquires) |
boolean |
tryLock() |
boolean |
tryLock(long time,
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, tryReleaseSharedgetExclusiveOwnerThread, setExclusiveOwnerThreadpublic void lockInterruptibly()
throws InterruptedException
lockInterruptibly 在接口中 LockInterruptedExceptionpublic boolean tryLock(long time,
TimeUnit unit)
throws InterruptedException
tryLock 在接口中 LockInterruptedExceptionpublic boolean isHeldByCurrentThread()
public Thread getOwner()
public Condition newCondition()
newCondition 在接口中 Lockprotected boolean tryAcquire(int acquires)
tryAcquire 在类中 AbstractQueuedSynchronizerprotected boolean tryRelease(int releases)
tryRelease 在类中 AbstractQueuedSynchronizerprotected boolean isHeldExclusively()
Copyright © 2021. All rights reserved.