8 |
|
|
9 |
|
import java.io.Serializable; |
10 |
|
import java.util.Collection; |
11 |
– |
import java.util.Collections; |
11 |
|
import java.util.List; |
12 |
|
import java.util.RandomAccess; |
14 |
– |
import java.util.Map; |
13 |
|
import java.lang.ref.WeakReference; |
14 |
|
import java.lang.ref.ReferenceQueue; |
15 |
|
import java.util.concurrent.Callable; |
16 |
|
import java.util.concurrent.CancellationException; |
17 |
|
import java.util.concurrent.ExecutionException; |
20 |
– |
import java.util.concurrent.Executor; |
21 |
– |
import java.util.concurrent.ExecutorService; |
18 |
|
import java.util.concurrent.Future; |
19 |
|
import java.util.concurrent.RejectedExecutionException; |
20 |
|
import java.util.concurrent.RunnableFuture; |
161 |
|
* See the internal documentation of class ForkJoinPool for a |
162 |
|
* general implementation overview. ForkJoinTasks are mainly |
163 |
|
* responsible for maintaining their "status" field amidst relays |
164 |
< |
* to methods in ForkJoinWorkerThread and ForkJoinPool. The |
165 |
< |
* methods of this class are more-or-less layered into (1) basic |
166 |
< |
* status maintenance (2) execution and awaiting completion (3) |
167 |
< |
* user-level methods that additionally report results. This is |
168 |
< |
* sometimes hard to see because this file orders exported methods |
169 |
< |
* in a way that flows well in javadocs. |
164 |
> |
* to methods in ForkJoinWorkerThread and ForkJoinPool. |
165 |
> |
* |
166 |
> |
* The methods of this class are more-or-less layered into |
167 |
> |
* (1) basic status maintenance |
168 |
> |
* (2) execution and awaiting completion |
169 |
> |
* (3) user-level methods that additionally report results. |
170 |
> |
* This is sometimes hard to see because this file orders exported |
171 |
> |
* methods in a way that flows well in javadocs. |
172 |
|
*/ |
173 |
|
|
174 |
|
/* |
489 |
|
if (e == null || (ex = e.ex) == null) |
490 |
|
return null; |
491 |
|
if (e.thrower != Thread.currentThread().getId()) { |
492 |
< |
Class ec = ex.getClass(); |
492 |
> |
Class<? extends Throwable> ec = ex.getClass(); |
493 |
|
try { |
494 |
|
Constructor<?> noArgCtor = null; |
495 |
|
Constructor<?>[] cs = ec.getConstructors();// public ctors only |
695 |
|
if (t != null) { |
696 |
|
if (ex != null) |
697 |
|
t.cancel(false); |
698 |
< |
else if (t.doJoin() < NORMAL && ex == null) |
698 |
> |
else if (t.doJoin() < NORMAL) |
699 |
|
ex = t.getException(); |
700 |
|
} |
701 |
|
} |
752 |
|
if (t != null) { |
753 |
|
if (ex != null) |
754 |
|
t.cancel(false); |
755 |
< |
else if (t.doJoin() < NORMAL && ex == null) |
755 |
> |
else if (t.doJoin() < NORMAL) |
756 |
|
ex = t.getException(); |
757 |
|
} |
758 |
|
} |