31 |
|
} |
32 |
|
|
33 |
|
for (int reps = 0; reps < 2; ++reps) { |
34 |
< |
ForkJoinPool g = (procs == 0) ? new ForkJoinPool() : |
34 |
> |
ForkJoinPool g = (procs == 0) ? ForkJoinPool.commonPool() : |
35 |
|
new ForkJoinPool(procs); |
36 |
– |
// g.setMaintainsParallelism(false); |
36 |
|
lastStealCount = g.getStealCount(); |
37 |
|
for (int i = 0; i < 20; ++i) { |
38 |
|
test(g, num); |
39 |
< |
Thread.sleep(50); |
39 |
> |
Thread.sleep(100); |
40 |
|
} |
41 |
|
System.out.println(g); |
42 |
< |
g.shutdown(); |
43 |
< |
if (!g.awaitTermination(8, TimeUnit.SECONDS)) { |
45 |
< |
System.out.println(g); |
46 |
< |
throw new Error(); |
47 |
< |
} |
48 |
< |
g = null; |
49 |
< |
// System.gc(); |
42 |
> |
if (g != ForkJoinPool.commonPool()) |
43 |
> |
g.shutdown(); |
44 |
|
Thread.sleep(500); |
45 |
|
} |
46 |
|
} |