41 |
|
} |
42 |
|
|
43 |
|
private <T> T testInvokeOnPool(ForkJoinPool pool, RecursiveTask<T> a) { |
44 |
< |
try { |
44 |
> |
try (PoolCleaner cleaner = cleaner(pool)) { |
45 |
|
checkNotDone(a); |
46 |
|
|
47 |
|
T result = pool.invoke(a); |
48 |
|
|
49 |
|
checkCompletedNormally(a, result); |
50 |
|
return result; |
51 |
– |
} finally { |
52 |
– |
joinPool(pool); |
51 |
|
} |
52 |
|
} |
53 |
|
|
328 |
|
FibTask f = new FibTask(8); |
329 |
|
assertSame(f, f.fork()); |
330 |
|
helpQuiesce(); |
331 |
+ |
while (!f.isDone()) // wait out race |
332 |
+ |
; |
333 |
|
assertEquals(0, getQueuedTaskCount()); |
334 |
|
checkCompletedNormally(f, 21); |
335 |
|
return NoResult; |