org.jboss.cache.lock
Class SemaphoreLock
java.lang.Object
java.util.concurrent.Semaphore
org.jboss.cache.lock.SemaphoreLock
- All Implemented Interfaces:
- Serializable, Lock
public class SemaphoreLock
- extends Semaphore
- implements Lock
Implements most of the methods of Lock using the Semaphore
implementation.
- See Also:
- Serialized Form
Methods inherited from class java.util.concurrent.Semaphore |
acquire, acquire, acquireUninterruptibly, acquireUninterruptibly, availablePermits, drainPermits, getQueuedThreads, getQueueLength, hasQueuedThreads, isFair, reducePermits, release, release, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire |
SemaphoreLock
public SemaphoreLock(int permits)
lock
public void lock()
- Specified by:
lock
in interface Lock
lockInterruptibly
public void lockInterruptibly()
throws InterruptedException
- Specified by:
lockInterruptibly
in interface Lock
- Throws:
InterruptedException
newCondition
public Condition newCondition()
- Specified by:
newCondition
in interface Lock
tryLock
public boolean tryLock()
- Specified by:
tryLock
in interface Lock
tryLock
public boolean tryLock(long arg0,
TimeUnit arg1)
throws InterruptedException
- Specified by:
tryLock
in interface Lock
- Throws:
InterruptedException
unlock
public void unlock()
- Specified by:
unlock
in interface Lock
Copyright © 2009 JBoss, a division of Red Hat. All Rights Reserved.