1932 |
|
* @param task the task to join |
1933 |
|
* @param mode if shared, exit upon completing any task |
1934 |
|
* if all workers are active |
1935 |
– |
* |
1935 |
|
*/ |
1936 |
|
private int helpComplete(ForkJoinTask<?> task, int mode) { |
1937 |
|
WorkQueue[] ws; WorkQueue q; int m, n, s, u; |
2555 |
|
* ongoing processing are automatically terminated upon program |
2556 |
|
* {@link System#exit}. Any program that relies on asynchronous |
2557 |
|
* task processing to complete before program termination should |
2558 |
< |
* invoke {@link #quiesceCommonPool}, or the timeout-based {@code |
2559 |
< |
* commonPool().}{@link #awaitQuiescence}, before exit. |
2558 |
> |
* invoke {@code commonPool().}{@link #awaitQuiescence}, before |
2559 |
> |
* exit. |
2560 |
|
* |
2561 |
|
* @return the common pool instance |
2562 |
|
*/ |
3001 |
|
* Possibly initiates an orderly shutdown in which previously |
3002 |
|
* submitted tasks are executed, but no new tasks will be |
3003 |
|
* accepted. Invocation has no effect on execution state if this |
3004 |
< |
* is the {@link #commonPool}, and no additional effect if |
3004 |
> |
* is the {@link #commonPool()}, and no additional effect if |
3005 |
|
* already shut down. Tasks that are in the process of being |
3006 |
|
* submitted concurrently during the course of this method may or |
3007 |
|
* may not be rejected. |
3019 |
|
/** |
3020 |
|
* Possibly attempts to cancel and/or stop all tasks, and reject |
3021 |
|
* all subsequently submitted tasks. Invocation has no effect on |
3022 |
< |
* execution state if this is the {@link #commonPool}, and no |
3022 |
> |
* execution state if this is the {@link #commonPool()}, and no |
3023 |
|
* additional effect if already shut down. Otherwise, tasks that |
3024 |
|
* are in the process of being submitted or executed concurrently |
3025 |
|
* during the course of this method may or may not be |
3171 |
|
* Waits and/or attempts to assist performing tasks indefinitely |
3172 |
|
* until the {@link #commonPool()} {@link #isQuiescent} |
3173 |
|
*/ |
3174 |
< |
public static void quiesceCommonPool() { |
3174 |
> |
static void quiesceCommonPool() { |
3175 |
|
common.awaitQuiescence(Long.MAX_VALUE, TimeUnit.NANOSECONDS); |
3176 |
|
} |
3177 |
|
|