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, tryAcquirepublic void lockInterruptibly()
throws InterruptedException
lockInterruptibly in interface LockInterruptedExceptionpublic Condition newCondition()
newCondition in interface Lockpublic boolean tryLock(long arg0,
TimeUnit arg1)
throws InterruptedException
tryLock in interface LockInterruptedExceptionCopyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.