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:
java.io.Serializable,java.util.concurrent.locks.Lock
public final class NonReentrantLock extends java.util.concurrent.locks.AbstractQueuedSynchronizer implements java.util.concurrent.locks.Lock- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.Threadownerprivate static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description NonReentrantLock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisHeldByCurrentThread()protected booleanisHeldExclusively()voidlock()voidlockInterruptibly()java.util.concurrent.locks.ConditionnewCondition()protected booleantryAcquire(int acquires)booleantryLock()booleantryLock(long time, java.util.concurrent.TimeUnit unit)protected booleantryRelease(int releases)voidunlock()-
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
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
owner
private java.lang.Thread owner
-
-
Method Detail
-
lock
public void lock()
- Specified by:
lockin interfacejava.util.concurrent.locks.Lock
-
lockInterruptibly
public void lockInterruptibly() throws java.lang.InterruptedException- Specified by:
lockInterruptiblyin interfacejava.util.concurrent.locks.Lock- Throws:
java.lang.InterruptedException
-
tryLock
public boolean tryLock()
- Specified by:
tryLockin interfacejava.util.concurrent.locks.Lock
-
tryLock
public boolean tryLock(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException- Specified by:
tryLockin interfacejava.util.concurrent.locks.Lock- Throws:
java.lang.InterruptedException
-
unlock
public void unlock()
- Specified by:
unlockin interfacejava.util.concurrent.locks.Lock
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-
newCondition
public java.util.concurrent.locks.Condition newCondition()
- Specified by:
newConditionin interfacejava.util.concurrent.locks.Lock
-
tryAcquire
protected boolean tryAcquire(int acquires)
- Overrides:
tryAcquirein classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
tryRelease
protected boolean tryRelease(int releases)
- Overrides:
tryReleasein classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
isHeldExclusively
protected boolean isHeldExclusively()
- Overrides:
isHeldExclusivelyin classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
-