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.Thread
owner
private static long
serialVersionUID
-
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()
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()
-
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:
lock
in interfacejava.util.concurrent.locks.Lock
-
lockInterruptibly
public void lockInterruptibly() throws java.lang.InterruptedException
- Specified by:
lockInterruptibly
in interfacejava.util.concurrent.locks.Lock
- Throws:
java.lang.InterruptedException
-
tryLock
public boolean tryLock()
- Specified by:
tryLock
in interfacejava.util.concurrent.locks.Lock
-
tryLock
public boolean tryLock(long time, java.util.concurrent.TimeUnit unit) throws java.lang.InterruptedException
- Specified by:
tryLock
in interfacejava.util.concurrent.locks.Lock
- Throws:
java.lang.InterruptedException
-
unlock
public void unlock()
- Specified by:
unlock
in interfacejava.util.concurrent.locks.Lock
-
isHeldByCurrentThread
public boolean isHeldByCurrentThread()
-
newCondition
public java.util.concurrent.locks.Condition newCondition()
- Specified by:
newCondition
in interfacejava.util.concurrent.locks.Lock
-
tryAcquire
protected boolean tryAcquire(int acquires)
- Overrides:
tryAcquire
in classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
tryRelease
protected boolean tryRelease(int releases)
- Overrides:
tryRelease
in classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
isHeldExclusively
protected boolean isHeldExclusively()
- Overrides:
isHeldExclusively
in classjava.util.concurrent.locks.AbstractQueuedSynchronizer
-
-