org.ow2.util.pool.impl.enhanced.internal.lock.impl
Class BasicLock

java.lang.Object
  extended by org.ow2.util.pool.impl.enhanced.internal.lock.impl.BasicLock
All Implemented Interfaces:
java.util.concurrent.locks.Lock

public class BasicLock
extends java.lang.Object
implements java.util.concurrent.locks.Lock

This lock is a non reentrent lock which delay signal and signalAll to optimize processor use. In addition to that it provides a clearAllSignal method.

Author:
Gael Lalire

Constructor Summary
BasicLock()
           
 
Method Summary
 void lock()
           
 void lockInterruptibly()
           
 BasicCondition newCondition()
           
 boolean tryLock()
           
 boolean tryLock(long time, java.util.concurrent.TimeUnit unit)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicLock

public BasicLock()
Method Detail

lock

public void lock()
Specified by:
lock in interface java.util.concurrent.locks.Lock

unlock

public void unlock()
Specified by:
unlock in interface java.util.concurrent.locks.Lock

lockInterruptibly

public void lockInterruptibly()
                       throws java.lang.InterruptedException
Specified by:
lockInterruptibly in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException

newCondition

public BasicCondition newCondition()
Specified by:
newCondition in interface java.util.concurrent.locks.Lock

tryLock

public boolean tryLock()
Specified by:
tryLock in interface java.util.concurrent.locks.Lock

tryLock

public boolean tryLock(long time,
                       java.util.concurrent.TimeUnit unit)
                throws java.lang.InterruptedException
Specified by:
tryLock in interface java.util.concurrent.locks.Lock
Throws:
java.lang.InterruptedException


Copyright © 2007-2009 OW2 Consortium. All Rights Reserved.