8 |
|
import java.util.concurrent.ForkJoinPool; |
9 |
|
import java.util.concurrent.ForkJoinTask; |
10 |
|
import java.util.concurrent.CountedCompleter; |
11 |
– |
import java.util.concurrent.ForkJoinWorkerThread; |
12 |
– |
import java.util.concurrent.RecursiveAction; |
13 |
– |
import java.util.concurrent.TimeUnit; |
11 |
|
import java.util.concurrent.TimeoutException; |
12 |
|
import java.util.concurrent.atomic.AtomicInteger; |
16 |
– |
import java.util.concurrent.atomic.AtomicIntegerFieldUpdater; |
13 |
|
import java.util.concurrent.atomic.AtomicReference; |
14 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
15 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
208 |
|
final AtomicInteger onCompletionN = new AtomicInteger(0); |
209 |
|
final AtomicInteger onExceptionalCompletionN = new AtomicInteger(0); |
210 |
|
final AtomicInteger setRawResultN = new AtomicInteger(0); |
211 |
< |
final AtomicReference<Object> rawResult = new AtomicReference<>(null); |
211 |
> |
final AtomicReference<Object> rawResult = new AtomicReference<Object>(null); |
212 |
|
int computeN() { return computeN.get(); } |
213 |
|
int onCompletionN() { return onCompletionN.get(); } |
214 |
|
int onExceptionalCompletionN() { return onExceptionalCompletionN.get(); } |
495 |
|
// Invocation tests use some interdependent task classes |
496 |
|
// to better test propagation etc |
497 |
|
|
498 |
< |
|
499 |
< |
// Version of Fibonacci with different classes for left vs right forks |
498 |
> |
/** |
499 |
> |
* Version of Fibonacci with different classes for left vs right forks |
500 |
> |
*/ |
501 |
|
abstract class CCF extends CheckedCC { |
502 |
|
int number; |
503 |
|
int rnumber; |
1133 |
|
} |
1134 |
|
|
1135 |
|
/** |
1136 |
< |
* invokeAll(collection) throws exception if any task does |
1136 |
> |
* invokeAll(collection) throws exception if any task does |
1137 |
|
*/ |
1138 |
|
public void testAbnormalInvokeAllCollection() { |
1139 |
|
ForkJoinTask a = new CheckedRecursiveAction() { |
1798 |
|
} |
1799 |
|
|
1800 |
|
/** |
1801 |
< |
* invokeAll(collection) throws exception if any task does |
1801 |
> |
* invokeAll(collection) throws exception if any task does |
1802 |
|
*/ |
1803 |
|
public void testAbnormalInvokeAllCollectionSingleton() { |
1804 |
|
ForkJoinTask a = new CheckedRecursiveAction() { |