ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/ForkJoinTask.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/ForkJoinTask.java (file contents):
Revision 1.130 by dl, Mon Feb 3 21:07:49 2020 UTC vs.
Revision 1.131 by dl, Tue Feb 4 12:38:06 2020 UTC

# Line 112 | Line 112 | import java.util.concurrent.locks.LockSu
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.
115 > * mayInterruptIfRunning} argument, separating task cancellation from
116 > * the interruption status of threads running tasks. However, the
117 > * method is overridable to accommodate cases in which running tasks
118 > * must be cancelled using interrupts. This may arise when adapting
119 > * Callables that cannot check {@code isCancelled()} task status.
120 > * Tasks constructed with the (@link #adaptInterruptible) adaptor
121 > * track and interrupt the running thread upon {@code
122 > * cancel(true)}. Reliable usage requires awareness of potential
123 > * consequences: Method bodies should ignore stray interrupts to cope
124 > * with the inherent possibility that a late interrupt issued by
125 > * another thread after a given task has completed may (inadvertently)
126 > * interrupt some future task. Further, interruptible tasks should not
127 > * in general create subtasks, because an interrupt intended for a
128 > * given task may be consumed by one of its subtasks, or vice versa.
129   *
130   * <p>The ForkJoinTask class is not usually directly subclassed.
131   * Instead, you subclass one of the abstract classes that support a

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines