@OpenApiAll
public class BlockingControl
extends java.lang.Object
Constructor and Description |
---|
BlockingControl()
Creates a control.
|
Modifier and Type | Method and Description |
---|---|
void |
expandPermits(int permit)
Reduce the number of available permits by the indicated reduction.
|
void |
lock(int permit)
Acquires a permit from this control, blocking until available, or the thread is interrupted.
|
void |
reducePermits(int permit)
Expand the number of available permits.
|
int |
remainPermits()
Returns the current number of permits remaining in this control.
|
public void lock(int permit) throws java.lang.InterruptedException
permit
- the number of permits to acquirejava.lang.InterruptedException
- if the current thread is interruptedpublic void expandPermits(int permit)
permit
- the number of permits to removepublic void reducePermits(int permit)
permit
- the number of permits to removepublic int remainPermits()
Copyright © 2010 - No Magic Asia