103 |
|
/* |
104 |
|
* This class specializes ThreadPoolExecutor implementation by |
105 |
|
* |
106 |
< |
* 1. Using a custom task type, ScheduledFutureTask for |
107 |
< |
* tasks, even those that don't require scheduling (i.e., |
108 |
< |
* those submitted using ExecutorService execute, not |
109 |
< |
* ScheduledExecutorService methods) which are treated as |
110 |
< |
* delayed tasks with a delay of zero. |
106 |
> |
* 1. Using a custom task type ScheduledFutureTask, even for tasks |
107 |
> |
* that don't require scheduling because they are submitted |
108 |
> |
* using ExecutorService rather than ScheduledExecutorService |
109 |
> |
* methods, which are treated as tasks with a delay of zero. |
110 |
|
* |
111 |
|
* 2. Using a custom queue (DelayedWorkQueue), a variant of |
112 |
|
* unbounded DelayQueue. The lack of capacity constraint and |
153 |
|
/** Sequence number to break ties FIFO */ |
154 |
|
private final long sequenceNumber; |
155 |
|
|
156 |
< |
/** The time the task is enabled to execute in nanoTime units */ |
156 |
> |
/** The nanoTime-based time when the task is enabled to execute. */ |
157 |
|
private volatile long time; |
158 |
|
|
159 |
|
/** |
160 |
< |
* Period in nanoseconds for repeating tasks. |
160 |
> |
* Period for repeating tasks, in nanoseconds. |
161 |
|
* A positive value indicates fixed-rate execution. |
162 |
|
* A negative value indicates fixed-delay execution. |
163 |
|
* A value of 0 indicates a non-repeating (one-shot) task. |