private final class SequentialExecutor.QueueWorker
extends java.lang.Object
implements java.lang.Runnable
SequentialExecutor.queue
until it is empty.Modifier and Type | Field and Description |
---|---|
(package private) java.lang.Runnable |
task |
Modifier | Constructor and Description |
---|---|
private |
QueueWorker() |
Modifier and Type | Method and Description |
---|---|
void |
run() |
java.lang.String |
toString() |
private void |
workOnQueue()
Continues executing tasks from
SequentialExecutor.queue until it is empty. |
public void run()
run
in interface java.lang.Runnable
private void workOnQueue()
SequentialExecutor.queue
until it is empty.
The thread's interrupt bit is cleared before execution of each task.
If the Thread in use is interrupted before or during execution of the tasks in SequentialExecutor.queue
, the Executor will complete its tasks, and then restore the interruption. This means
that once the Thread returns to the Executor that this Executor composes, the interruption
will still be present. If the composed Executor is an ExecutorService, it can respond to
shutdown() by returning tasks queued on that Thread after SequentialExecutor.worker
drains the queue.
public java.lang.String toString()
toString
in class java.lang.Object