Package org.jboss.netty.util.internal
Class NonReentrantLock
- java.lang.Object
-
- java.util.concurrent.locks.AbstractOwnableSynchronizer
-
- java.util.concurrent.locks.AbstractQueuedSynchronizer
-
- org.jboss.netty.util.internal.NonReentrantLock
-
- All Implemented Interfaces:
Serializable
,Lock
public final class NonReentrantLock extends AbstractQueuedSynchronizer implements Lock
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject
-
-
Constructor Summary
Constructors Constructor Description NonReentrantLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description 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()
-
Methods inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
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, tryReleaseShared
-
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
-
-
-
-
Method Detail
-
lockInterruptibly
public void lockInterruptibly() throws InterruptedException
- Specified by:
lockInterruptibly
in interfaceLock
- Throws:
InterruptedException
-
tryLock
public boolean tryLock(long time, TimeUnit unit) throws InterruptedException
- Specified by:
tryLock
in interfaceLock
- Throws:
InterruptedException
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-
newCondition
public Condition newCondition()
- Specified by:
newCondition
in interfaceLock
-
tryAcquire
protected boolean tryAcquire(int acquires)
- Overrides:
tryAcquire
in classAbstractQueuedSynchronizer
-
tryRelease
protected boolean tryRelease(int releases)
- Overrides:
tryRelease
in classAbstractQueuedSynchronizer
-
isHeldExclusively
protected boolean isHeldExclusively()
- Overrides:
isHeldExclusively
in classAbstractQueuedSynchronizer
-
-