public class SemaphoreLock extends Semaphore implements Lock
Semaphore
implementation.Constructor and Description |
---|
SemaphoreLock(int permits) |
Modifier and Type | Method and Description |
---|---|
void |
lock() |
void |
lockInterruptibly() |
Condition |
newCondition() |
boolean |
tryLock() |
boolean |
tryLock(long arg0,
TimeUnit arg1) |
void |
unlock() |
acquire, acquire, acquireUninterruptibly, acquireUninterruptibly, availablePermits, drainPermits, getQueuedThreads, getQueueLength, hasQueuedThreads, isFair, reducePermits, release, release, toString, tryAcquire, tryAcquire, tryAcquire, tryAcquire
public void lockInterruptibly() throws InterruptedException
lockInterruptibly
in interface Lock
InterruptedException
public Condition newCondition()
newCondition
in interface Lock
public boolean tryLock(long arg0, TimeUnit arg1) throws InterruptedException
tryLock
in interface Lock
InterruptedException
Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.