Package org.eclipse.jetty.util.thread
Class SerializedExecutor
- java.lang.Object
-
- org.eclipse.jetty.util.thread.SerializedExecutor
-
- All Implemented Interfaces:
java.util.concurrent.Executor
public class SerializedExecutor extends java.lang.Object implements java.util.concurrent.Executor
An executor than ensurers serial execution of submitted tasks.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
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
SerializedExecutor.ErrorHandlingTask
Error handling taskprivate class
SerializedExecutor.Link
-
Field Summary
Fields Modifier and Type Field Description private java.util.concurrent.atomic.AtomicReference<SerializedExecutor.Link>
_tail
-
Constructor Summary
Constructors Constructor Description SerializedExecutor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
execute(java.lang.Runnable task)
protected void
onError(java.lang.Runnable task, java.lang.Throwable t)
private void
run(SerializedExecutor.Link link)
-
-
-
Field Detail
-
_tail
private final java.util.concurrent.atomic.AtomicReference<SerializedExecutor.Link> _tail
-
-
Method Detail
-
execute
public void execute(java.lang.Runnable task)
- Specified by:
execute
in interfacejava.util.concurrent.Executor
-
onError
protected void onError(java.lang.Runnable task, java.lang.Throwable t)
-
run
private void run(SerializedExecutor.Link link)
-
-