public class SerializedExecutor
extends java.lang.Object
implements java.util.concurrent.Executor
Callers of this execute will never block in the executor, but they may be required to either execute the task they submit or tasks submitted by other threads whilst they are executing tasks.
This class was inspired by the public domain class NonBlockingMutexExecutor
Modifier and Type | Class and Description |
---|---|
static interface |
SerializedExecutor.ErrorHandlingTask
Error handling task
|
private class |
SerializedExecutor.Link |
Modifier and Type | Field and Description |
---|---|
private java.util.concurrent.atomic.AtomicReference<SerializedExecutor.Link> |
_tail |
Constructor and Description |
---|
SerializedExecutor() |
Modifier and Type | Method and Description |
---|---|
void |
execute(java.lang.Runnable task) |
protected void |
onError(java.lang.Runnable task,
java.lang.Throwable t) |
private void |
run(SerializedExecutor.Link link) |
private final java.util.concurrent.atomic.AtomicReference<SerializedExecutor.Link> _tail
public void execute(java.lang.Runnable task)
execute
in interface java.util.concurrent.Executor
protected void onError(java.lang.Runnable task, java.lang.Throwable t)
private void run(SerializedExecutor.Link link)