183 |
|
public FJException() { super(); } |
184 |
|
} |
185 |
|
|
186 |
< |
// An invalid return value for Fib |
186 |
> |
/** An invalid return value for Fib. */ |
187 |
|
static final Integer NoResult = Integer.valueOf(-17); |
188 |
|
|
189 |
< |
// A simple recursive task for testing |
189 |
> |
/** A simple recursive task for testing. */ |
190 |
|
final class FibTask extends CheckedRecursiveTask<Integer> { |
191 |
|
final int number; |
192 |
|
FibTask(int n) { number = n; } |
204 |
|
} |
205 |
|
} |
206 |
|
|
207 |
< |
// A recursive action failing in base case |
207 |
> |
/** A recursive action failing in base case. */ |
208 |
|
final class FailingFibTask extends RecursiveTask<Integer> { |
209 |
|
final int number; |
210 |
|
int result; |
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; |