# | Line 110 | Line 110 | public class FutureTask<V> implements Fu | |
---|---|---|
110 | Object r = runner; | |
111 | if (r == DONE || r == CANCELLED) | |
112 | return false; | |
113 | + | runner = CANCELLED; |
114 | if (mayInterruptIfRunning && r != null && r instanceof Thread) | |
115 | ((Thread)r).interrupt(); | |
116 | < | runner = CANCELLED; |
116 | > | // propagate to nested future |
117 | > | Runnable subtask = runnable; |
118 | > | if (subtask != null && subtask instanceof Future) |
119 | > | ((Future<?>)subtask).cancel(false); |
120 | } | |
121 | finally{ | |
122 | lock.unlock(); |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |