public class BoundedExecutor
extends java.lang.Object
Constructor and Description |
---|
BoundedExecutor(java.util.concurrent.Executor exec,
int bound)
Constructor that sets the executor and semaphore upper bound
|
Modifier and Type | Method and Description |
---|---|
void |
submitTask(java.lang.Runnable instance)
Calls
run method of given instance; blocks until a thread is available |
public BoundedExecutor(java.util.concurrent.Executor exec, int bound)
exec
- the executor object that submits runnable tasksbound
- the int maximum number of permits available for the semaphore; this value
may be negative, in which case releases must occur before any acquires will be granted