org.jboss.netty.util.internal
Class NonReentrantLock

java.lang.Object
  extended by java.util.concurrent.locks.AbstractOwnableSynchronizer
      extended by java.util.concurrent.locks.AbstractQueuedSynchronizer
          extended by org.jboss.netty.util.internal.NonReentrantLock
All Implemented Interfaces:
Serializable, Lock

public final class NonReentrantLock
extends AbstractQueuedSynchronizer
implements Lock

Version:
$Rev: 2115 $, $Date: 2010-02-01 15:21:49 +0900 (Mon, 01 Feb 2010) $
Author:
The Netty Project, Trustin Lee
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.concurrent.locks.AbstractQueuedSynchronizer
AbstractQueuedSynchronizer.ConditionObject
 
Constructor Summary
NonReentrantLock()
           
 
Method Summary
 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, hasQueuedThreads, hasWaiters, isQueued, owns, release, releaseShared, setState, toString, tryAcquireNanos, tryAcquireShared, tryAcquireSharedNanos, tryReleaseShared
 
Methods inherited from class java.util.concurrent.locks.AbstractOwnableSynchronizer
getExclusiveOwnerThread, setExclusiveOwnerThread
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NonReentrantLock

public NonReentrantLock()
Method Detail

lock

public void lock()
Specified by:
lock in interface Lock

lockInterruptibly

public void lockInterruptibly()
                       throws InterruptedException
Specified by:
lockInterruptibly in interface Lock
Throws:
InterruptedException

tryLock

public boolean tryLock()
Specified by:
tryLock in interface Lock

tryLock

public boolean tryLock(long time,
                       TimeUnit unit)
                throws InterruptedException
Specified by:
tryLock in interface Lock
Throws:
InterruptedException

unlock

public void unlock()
Specified by:
unlock in interface Lock

isHeldByCurrentThread

public boolean isHeldByCurrentThread()

newCondition

public Condition newCondition()
Specified by:
newCondition in interface Lock

tryAcquire

protected final boolean tryAcquire(int acquires)
Overrides:
tryAcquire in class AbstractQueuedSynchronizer

tryRelease

protected final boolean tryRelease(int releases)
Overrides:
tryRelease in class AbstractQueuedSynchronizer

isHeldExclusively

protected final boolean isHeldExclusively()
Overrides:
isHeldExclusively in class AbstractQueuedSynchronizer


Copyright © 2008-2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.