public interface IKSemaphore
Modifier and Type | Method and Description |
---|---|
void |
acquire(IKAction action,
int permits)
Acquires the given number of permits from this semaphore,
blocking until all are available.
|
int |
availablePermits()
Returns the current number of permits available in this semaphore.
|
Map |
getQueue()
Get the actions waiting on the semaphore.
|
int |
getQueueLength()
Returns the number of actions waiting to acquire.
|
int |
reducePermits(int reduction)
Shrinks the number of available permits by the indicated reduction.
|
void |
release()
Releases a permit, returning it to the semaphore.
|
void |
release(int permits)
Releases the given number of permits, returning them to the semaphore.
|
String |
toString()
Returns a string identifying this semaphore, as well as its state.
|
boolean |
tryAcquire()
Acquires a permit from this semaphore, only if one is available at the time of invocation.
|
boolean |
tryAcquire(int permits)
Acquires the given number of permits from this semaphore, only if all are available at the time of invocation.
|
void acquire(IKAction action, int permits)
int availablePermits()
int getQueueLength()
int reducePermits(int reduction)
void release()
void release(int permits)
String toString()
boolean tryAcquire()
boolean tryAcquire(int permits)
Map getQueue()
© Copyright IBM Corp. 2013. All rights reserved.