692 |
|
} |
693 |
|
|
694 |
|
/** |
695 |
< |
* Asserts that the results of this task's computation will not be |
696 |
< |
* used. If a cancellation occurs before attempting to execute this |
697 |
< |
* task, execution will be suppressed, {@link #isCancelled} |
698 |
< |
* will report true, and {@link #join} will result in a |
699 |
< |
* {@code CancellationException} being thrown. Otherwise, when |
700 |
< |
* cancellation races with completion, there are no guarantees |
701 |
< |
* about whether {@code isCancelled} will report {@code true}, |
702 |
< |
* whether {@code join} will return normally or via an exception, |
703 |
< |
* or whether these behaviors will remain consistent upon repeated |
704 |
< |
* invocation. |
695 |
> |
* Attempts to cancel execution of this task. This attempt will |
696 |
> |
* fail if the task has already completed, has already been |
697 |
> |
* cancelled, or could not be cancelled for some other reason. If |
698 |
> |
* successful, and this task has not started when cancel is |
699 |
> |
* called, execution of this task is suppressed, {@link |
700 |
> |
* #isCancelled} will report true, and {@link #join} will result |
701 |
> |
* in a {@code CancellationException} being thrown. |
702 |
|
* |
703 |
|
* <p>This method may be overridden in subclasses, but if so, must |
704 |
|
* still ensure that these minimal properties hold. In particular, |
710 |
|
* invoke {@link #completeExceptionally}. |
711 |
|
* |
712 |
|
* @param mayInterruptIfRunning this value is ignored in the |
713 |
< |
* default implementation because tasks are not in general |
713 |
> |
* default implementation because tasks are not |
714 |
|
* cancelled via interruption |
715 |
|
* |
716 |
|
* @return {@code true} if this task is now cancelled |
875 |
|
|
876 |
|
/** |
877 |
|
* Possibly executes tasks until the pool hosting the current task |
878 |
< |
* {@link ForkJoinPool#isQuiescent}. This method may be of use in |
879 |
< |
* designs in which many tasks are forked, but none are explicitly |
880 |
< |
* joined, instead executing them until all are processed. |
878 |
> |
* {@link ForkJoinPool#isQuiescent is quiescent}. This method may |
879 |
> |
* be of use in designs in which many tasks are forked, but none |
880 |
> |
* are explicitly joined, instead executing them until all are |
881 |
> |
* processed. |
882 |
|
* |
883 |
|
* <p>This method may be invoked only from within {@code |
884 |
|
* ForkJoinTask} computations (as may be determined using method |