111 |
|
* #getException} will return either the encountered exception or |
112 |
|
* {@link CancellationException}. |
113 |
|
* |
114 |
+ |
* <p>By default, method {@link #cancel} ignores its {@code |
115 |
+ |
* mayInterruptIfRunning} argument, to separate task cancellation from |
116 |
+ |
* thread status. However, the method is overridable. An adaptor |
117 |
+ |
* (@link #adaptInterruptible) for Callables does so by tracking and |
118 |
+ |
* interrupting the running thread upon {@code cancel(true)}. Usage |
119 |
+ |
* requires care. A late interrupt issued by another thread after the |
120 |
+ |
* task has completed may (inadvertently) interrupt some future task. |
121 |
+ |
* When using interruptible tasks, method bodies of all task code |
122 |
+ |
* should ignore stray interrupts. When applicable, {@code |
123 |
+ |
* isCancelled} or {@code isDone} can be used to distinguish cases. |
124 |
+ |
* |
125 |
|
* <p>The ForkJoinTask class is not usually directly subclassed. |
126 |
|
* Instead, you subclass one of the abstract classes that support a |
127 |
|
* particular style of fork/join processing, typically {@link |