9 |
|
import java.util.concurrent.ExecutionException; |
10 |
|
import java.util.concurrent.ForkJoinPool; |
11 |
|
import java.util.concurrent.ForkJoinTask; |
12 |
– |
import java.util.concurrent.ForkJoinWorkerThread; |
12 |
|
import java.util.concurrent.RecursiveAction; |
13 |
|
import java.util.concurrent.CountedCompleter; |
15 |
– |
import java.util.concurrent.ThreadLocalRandom; |
16 |
– |
import java.util.concurrent.TimeUnit; |
14 |
|
import java.util.concurrent.TimeoutException; |
15 |
|
import static java.util.concurrent.TimeUnit.SECONDS; |
16 |
|
import static java.util.concurrent.TimeUnit.MILLISECONDS; |
20 |
– |
import java.util.Arrays; |
17 |
|
import java.util.HashSet; |
18 |
|
|
19 |
|
public class ForkJoinPool8Test extends JSR166TestCase { |
475 |
|
FailingFibAction f = new FailingFibAction(8); |
476 |
|
assertSame(f, f.fork()); |
477 |
|
try { |
478 |
< |
f.get(5L, TimeUnit.SECONDS); |
478 |
> |
f.get(5L, SECONDS); |
479 |
|
shouldThrow(); |
480 |
|
} catch (ExecutionException success) { |
481 |
|
Throwable cause = success.getCause(); |
1537 |
|
* timeout elapsed |
1538 |
|
*/ |
1539 |
|
public void testAwaitQuiescence2() throws Exception { |
1540 |
+ |
/** |
1541 |
+ |
* """It is possible to disable or limit the use of threads in the |
1542 |
+ |
* common pool by setting the parallelism property to zero. However |
1543 |
+ |
* doing so may cause unjoined tasks to never be executed.""" |
1544 |
+ |
*/ |
1545 |
+ |
if ("0".equals(System.getProperty( |
1546 |
+ |
"java.util.concurrent.ForkJoinPool.common.parallelism"))) |
1547 |
+ |
return; |
1548 |
|
final ForkJoinPool p = new ForkJoinPool(); |
1549 |
|
try { |
1550 |
|
assertTrue(p.isQuiescent()); |