|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ISemaphore
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.hazelcast.core.Instance |
---|
Instance.InstanceType |
Method Summary | |
---|---|
void |
acquire()
Acquires a permit from this semaphore, blocking until one is available, or the thread is interrupted. |
void |
acquire(int permits)
Acquires the given number of permits from this semaphore, blocking until all are available, or the thread is interrupted. |
void |
acquireUninterruptibly()
Acquires a permit from this semaphore, blocking until one is available. |
void |
acquireUninterruptibly(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. |
int |
drainPermits()
Acquires and returns all permits that are immediately available. |
String |
getName()
Returns the name of this collection |
void |
reducePermits(int permits)
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. |
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. |
boolean |
tryAcquire(int permits,
long timeout,
TimeUnit unit)
Acquires the given number of permits from this semaphore, if all become available within the given waiting time and the current thread has not been interrupted. |
boolean |
tryAcquire(long timeout,
TimeUnit unit)
Acquires a permit from this semaphore, if one becomes available within the given waiting time and the current thread has not been interrupted. |
Methods inherited from interface com.hazelcast.core.Instance |
---|
destroy, getId, getInstanceType |
Method Detail |
---|
String getName()
void acquire() throws InterruptedException
InterruptedException
void acquireUninterruptibly()
boolean tryAcquire()
boolean tryAcquire(long timeout, TimeUnit unit)
timeout
- unit
-
void release()
void acquire(int permits) throws InterruptedException
permits
-
InterruptedException
void acquireUninterruptibly(int permits)
permits
- boolean tryAcquire(int permits)
permits
-
boolean tryAcquire(int permits, long timeout, TimeUnit unit)
permits
- timeout
- unit
-
void release(int permits)
permits
- int availablePermits()
int drainPermits()
void reducePermits(int permits)
permits
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |