| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv volatile int | |
| private static final long | |
| pack-priv volatile int | |
| private static final int | |
| pack-priv static final long | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv int | |
| pack-priv volatile DelayScheduler. | |
| private static final long | |
| pack-priv ForkJoinPool | |
| private static final int | |
| pack-priv int | |
| private static final Unsafe |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| private static void | |
| pack-priv final void | |
| pack-priv final boolean | |
| private static boolean | |
| pack-priv final int | |
| private void | |
| pack-priv static final long | |
| pack-priv final void | pend(DelayScheduler.
Inserts the task (if nonnull) to pending queue, to add, remove, or ignore depending on task status when processed. |
| private static int | Returns: current heap sizeReplaces removed heap element at index k, along with other cancelled nodes found while doing so. |
| public final void | run()
Overrides java. Implements java. Sets up and runs scheduling loop |
| pack-priv final int | |
| private int | Returns: negative if stop, else current heap size.Call only when pool run status is nonzero. |
| active | back to summary |
|---|---|
| pack-priv volatile int active | |
| ACTIVE | back to summary |
|---|---|
| private static final long ACTIVE | |
| cancelDelayedTasksOnShutdown | back to summary |
|---|---|
| pack-priv volatile int cancelDelayedTasksOnShutdown | |
| INITIAL_HEAP_CAPACITY | back to summary |
|---|---|
| private static final int INITIAL_HEAP_CAPACITY | |
| nanoTimeOffset | back to summary |
|---|---|
| pack-priv static final long nanoTimeOffset | |
| pad0 | back to summary |
|---|---|
| pack-priv int pad0 | |
| pad1 | back to summary |
|---|---|
| pack-priv int pad1 | |
| pad2 | back to summary |
|---|---|
| pack-priv int pad2 | |
| pad3 | back to summary |
|---|---|
| pack-priv int pad3 | |
| pad4 | back to summary |
|---|---|
| pack-priv int pad4 | |
| pad5 | back to summary |
|---|---|
| pack-priv int pad5 | |
| pad6 | back to summary |
|---|---|
| pack-priv int pad6 | |
| pad7 | back to summary |
|---|---|
| pack-priv int pad7 | |
| pad8 | back to summary |
|---|---|
| pack-priv int pad8 | |
| pad9 | back to summary |
|---|---|
| pack-priv int pad9 | |
| padA | back to summary |
|---|---|
| pack-priv int padA | |
| padB | back to summary |
|---|---|
| pack-priv int padB | |
| padC | back to summary |
|---|---|
| pack-priv int padC | |
| padD | back to summary |
|---|---|
| pack-priv int padD | |
| padE | back to summary |
|---|---|
| pack-priv int padE | |
| pending | back to summary |
|---|---|
| pack-priv volatile DelayScheduler. | |
| PENDING | back to summary |
|---|---|
| private static final long PENDING | |
| pool | back to summary |
|---|---|
| pack-priv ForkJoinPool pool | |
| POOL_STOPPING | back to summary |
|---|---|
| private static final int POOL_STOPPING | |
| restingSize | back to summary |
|---|---|
| pack-priv int restingSize | |
| U | back to summary |
|---|---|
| private static final Unsafe U | |
| DelayScheduler | back to summary |
|---|---|
| pack-priv DelayScheduler(ForkJoinPool p, String name) | |
| cancelAll | back to summary |
|---|---|
| private static void cancelAll(DelayScheduler. | |
| cancelDelayedTasksOnShutdown | back to summary |
|---|---|
| pack-priv final void cancelDelayedTasksOnShutdown() Turns on cancelDelayedTasksOnShutdown policy | |
| canShutDown | back to summary |
|---|---|
| pack-priv final boolean canShutDown() Returns true if (momentarily) inactive and heap is empty | |
| checkHeap | back to summary |
|---|---|
| private static boolean checkHeap(DelayScheduler. Invariant checks | |
| lastStableSize | back to summary |
|---|---|
| pack-priv final int lastStableSize() Returns the number of elements in heap when last idle | |
| loop | back to summary |
|---|---|
| private void loop(ForkJoinPool p) After initialization, repeatedly: 1. If apparently no work, if active, set tentatively inactive, else park until next trigger time, or indefinitely if none 2. Process pending tasks in batches, to add or remove from heap 3. Check for shutdown, either exiting or preparing for shutdown when empty 4. Trigger all enabled tasks by submitting them to pool or run if immediate | |
| now | back to summary |
|---|---|
| pack-priv static final long now() Returns System.nanoTime() with nanoTimeOffset | |
| pend | back to summary |
|---|---|
| pack-priv final void pend(DelayScheduler. Inserts the task (if nonnull) to pending queue, to add, remove, or ignore depending on task status when processed. | |
| replace | back to summary |
|---|---|
| private static int replace(DelayScheduler. Replaces removed heap element at index k, along with other cancelled nodes found while doing so.
| |
| run | back to summary |
|---|---|
| public final void run() Overrides java. Implements java. Sets up and runs scheduling loop | |
| signal | back to summary |
|---|---|
| pack-priv final int signal() Ensures the scheduler is not parked unless stopped. Returns negative if already stopped | |
| tryStop | back to summary |
|---|---|
| private int tryStop(ForkJoinPool p, DelayScheduler. Call only when pool run status is nonzero. Possibly cancels tasks and stops during pool shutdown and termination. If called when shutdown but not stopping, removes tasks according to policy if not already done so, and if not empty or pool not terminating, returns. Otherwise, cancels all tasks in heap and pending queue.
| |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv Callable | |
| pack-priv int | |
| pack-priv final boolean | |
| pack-priv final long | |
| pack-priv DelayScheduler. | |
| pack-priv ForkJoinPool | |
| pack-priv T | |
| pack-priv Runnable | |
| pack-priv long |
| Access | Constructor and Description |
|---|---|
| public | ScheduledForkJoinTask(long
initial delay, in nanoseconds delay, long 0 for one-shot, negative for fixed delay,
positive for fixed rate, in nanoseconds nextDelay, boolean if action is to be performed
by scheduler versus submitting to a WorkQueue isImmediate, Runnable action (null if implementing callable version) runnable, Callable<T> function (null if implementing runnable versions) callable, ForkJoinPool the pool for resubmissions and cancellations
(disabled if null) pool)Creates a new ScheduledForkJoinTask |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv final Object | |
| public final boolean | cancel(boolean mayInterruptIfRunning)
Overrides java. Implements java. Attempts to cancel execution of this task. |
| public int | compareTo(Delayed other)
Implements java. Compares this object with the specified object for order. |
| pack-priv final T | |
| public final long | getDelay(TimeUnit unit)
Implements java. Returns the remaining delay associated with this object, in the given time unit. |
| public final T | getRawResult()
Implements abstract java. Returns the result that would be returned by |
| pack-priv final boolean | |
| public void | |
| public final void | setRawResult(T v)
Implements abstract java. Forces the given value to be returned as a result. |
| callable | back to summary |
|---|---|
| pack-priv Callable<? extends T> callable | |
| heapIndex | back to summary |
|---|---|
| pack-priv int heapIndex | |
| isImmediate | back to summary |
|---|---|
| pack-priv final boolean isImmediate | |
| nextDelay | back to summary |
|---|---|
| pack-priv final long nextDelay | |
| nextPending | back to summary |
|---|---|
| pack-priv DelayScheduler. | |
| pool | back to summary |
|---|---|
| pack-priv ForkJoinPool pool | |
| result | back to summary |
|---|---|
| pack-priv T result | |
| runnable | back to summary |
|---|---|
| pack-priv Runnable runnable | |
| when | back to summary |
|---|---|
| pack-priv long when | |
| ScheduledForkJoinTask | back to summary |
|---|---|
| public ScheduledForkJoinTask(long delay, long nextDelay, boolean isImmediate, Runnable runnable, Callable<T> callable, ForkJoinPool pool) Creates a new ScheduledForkJoinTask
| |
| adaptee | back to summary |
|---|---|
| pack-priv final Object adaptee() Overrides java. | |
| cancel | back to summary |
|---|---|
| public final boolean cancel(boolean mayInterruptIfRunning) Overrides java. Implements java. Doc from java. Attempts to cancel execution of this task. This method has no
effect if the task is already completed or cancelled, or could
not be cancelled for some other reason. Otherwise, if this
task has not started when The return value from this method does not necessarily
indicate whether the task is now cancelled; use | |
| compareTo | back to summary |
|---|---|
| public int compareTo(Delayed other) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that | |
| compute | back to summary |
|---|---|
| pack-priv final T compute() throws Exception Implements abstract java. | |
| getDelay | back to summary |
|---|---|
| public final long getDelay(TimeUnit unit) Implements java. Doc from java. Returns the remaining delay associated with this object, in the given time unit. | |
| getRawResult | back to summary |
|---|---|
| public final T getRawResult() Implements abstract java. Doc from java. Returns the result that would be returned by | |
| postExec | back to summary |
|---|---|
| pack-priv final boolean postExec() Overrides java. | |
| schedule | back to summary |
|---|---|
| public void schedule() | |
| setRawResult | back to summary |
|---|---|
| public final void setRawResult(T v) Implements abstract java. Doc from java. Forces the given value to be returned as a result. This method is designed to support extensions, and should not in general be called otherwise. | |