510 |
|
|
511 |
|
/** |
512 |
|
* Attempts to cancel execution of this task. This attempt will |
513 |
< |
* fail if the task has already completed, has already been |
514 |
< |
* cancelled, or could not be cancelled for some other reason. If |
515 |
< |
* successful, and this task has not started when {@code cancel} |
516 |
< |
* is called, execution of this task is suppressed, {@link |
517 |
< |
* #isCancelled} will report true, and {@link #join} will result |
518 |
< |
* in a {@code CancellationException} being thrown. |
513 |
> |
* fail if the task has already completed or could not be |
514 |
> |
* cancelled for some other reason. If successful, and this task |
515 |
> |
* has not started when {@code cancel} is called, execution of |
516 |
> |
* this task is suppressed, {@link #isCancelled} will report true, |
517 |
> |
* and {@link #join} will result in a {@code CancellationException} |
518 |
> |
* being thrown. |
519 |
> |
* |
520 |
> |
* <p>After this method returns, subsequent calls to {@link |
521 |
> |
* #isDone} will always return {@code true}. Subsequent calls to |
522 |
> |
* {@link #isCancelled} will always return {@code true} if this |
523 |
> |
* method returned {@code true}. |
524 |
|
* |
525 |
|
* <p>This method may be overridden in subclasses, but if so, must |
526 |
|
* still ensure that these minimal properties hold. In particular, |