274 |
|
// test join() |
275 |
|
assertSame(f, f.fork()); |
276 |
|
currentThread.interrupt(); |
277 |
– |
assertTrue(currentThread.isInterrupted()); |
277 |
|
assertNull(f.join()); |
278 |
|
Thread.interrupted(); |
279 |
|
assertEquals(21, f.result); |
283 |
|
f.cancel(true); |
284 |
|
assertSame(f, f.fork()); |
285 |
|
currentThread.interrupt(); |
287 |
– |
assertTrue(currentThread.isInterrupted()); |
286 |
|
try { |
287 |
|
f.join(); |
288 |
|
shouldThrow(); |
295 |
|
f.completeExceptionally(new FJException()); |
296 |
|
assertSame(f, f.fork()); |
297 |
|
currentThread.interrupt(); |
300 |
– |
assertTrue(currentThread.isInterrupted()); |
298 |
|
try { |
299 |
|
f.join(); |
300 |
|
shouldThrow(); |
307 |
|
f = new FibAction(8); |
308 |
|
assertSame(f, f.fork()); |
309 |
|
currentThread.interrupt(); |
313 |
– |
assertTrue(currentThread.isInterrupted()); |
310 |
|
f.quietlyJoin(); |
311 |
|
Thread.interrupted(); |
312 |
|
assertEquals(21, f.result); |
316 |
|
f.cancel(true); |
317 |
|
assertSame(f, f.fork()); |
318 |
|
currentThread.interrupt(); |
323 |
– |
assertTrue(currentThread.isInterrupted()); |
319 |
|
f.quietlyJoin(); |
320 |
|
Thread.interrupted(); |
321 |
|
checkCancelled(f); |
324 |
|
f.completeExceptionally(new FJException()); |
325 |
|
assertSame(f, f.fork()); |
326 |
|
currentThread.interrupt(); |
332 |
– |
assertTrue(currentThread.isInterrupted()); |
327 |
|
f.quietlyJoin(); |
328 |
|
Thread.interrupted(); |
329 |
|
checkCompletedAbnormally(f, f.getException()); |