final class SerializingExecutor
extends java.lang.Object
implements java.util.concurrent.Executor
Modifier and Type | Class and Description |
---|---|
private class |
SerializingExecutor.TaskRunner
Task that actually runs the Runnables.
|
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.Executor |
executor
Underlying executor that all submitted Runnable objects are run on.
|
private java.lang.Object |
internalLock |
private boolean |
isThreadScheduled
We explicitly keep track of if the TaskRunner is currently scheduled to
run.
|
private static java.util.logging.Logger |
log |
private SerializingExecutor.TaskRunner |
taskRunner
The object that actually runs the Runnables submitted, reused.
|
private java.util.Queue<java.lang.Runnable> |
waitQueue
A list of Runnables to be run in order.
|
Constructor and Description |
---|
SerializingExecutor(java.util.concurrent.Executor executor)
Creates a SerializingExecutor, running tasks using
executor . |
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable r)
Runs the given runnable strictly after all Runnables that were submitted
before it, and using the
executor passed to the constructor. |
private static final java.util.logging.Logger log
private final java.util.concurrent.Executor executor
private final java.util.Queue<java.lang.Runnable> waitQueue
private boolean isThreadScheduled
private final SerializingExecutor.TaskRunner taskRunner
private final java.lang.Object internalLock