263 |
|
// test join() |
264 |
|
assertSame(f, f.fork()); |
265 |
|
currentThread.interrupt(); |
266 |
– |
assertTrue(currentThread.isInterrupted()); |
266 |
|
assertNull(f.join()); |
267 |
|
Thread.interrupted(); |
268 |
|
assertEquals(21, f.result); |
272 |
|
f.cancel(true); |
273 |
|
assertSame(f, f.fork()); |
274 |
|
currentThread.interrupt(); |
276 |
– |
assertTrue(currentThread.isInterrupted()); |
275 |
|
try { |
276 |
|
f.join(); |
277 |
|
shouldThrow(); |
284 |
|
f.completeExceptionally(new FJException()); |
285 |
|
assertSame(f, f.fork()); |
286 |
|
currentThread.interrupt(); |
289 |
– |
assertTrue(currentThread.isInterrupted()); |
287 |
|
try { |
288 |
|
f.join(); |
289 |
|
shouldThrow(); |
296 |
|
f = new FibAction(8); |
297 |
|
assertSame(f, f.fork()); |
298 |
|
currentThread.interrupt(); |
302 |
– |
assertTrue(currentThread.isInterrupted()); |
299 |
|
f.quietlyJoin(); |
300 |
|
Thread.interrupted(); |
301 |
|
assertEquals(21, f.result); |
305 |
|
f.cancel(true); |
306 |
|
assertSame(f, f.fork()); |
307 |
|
currentThread.interrupt(); |
312 |
– |
assertTrue(currentThread.isInterrupted()); |
308 |
|
f.quietlyJoin(); |
309 |
|
Thread.interrupted(); |
310 |
|
checkCancelled(f); |
313 |
|
f.completeExceptionally(new FJException()); |
314 |
|
assertSame(f, f.fork()); |
315 |
|
currentThread.interrupt(); |
321 |
– |
assertTrue(currentThread.isInterrupted()); |
316 |
|
f.quietlyJoin(); |
317 |
|
Thread.interrupted(); |
318 |
|
checkCompletedAbnormally(f, f.getException()); |
359 |
|
f = fibActions[0]; |
360 |
|
assertFalse(ForkJoinTask.inForkJoinPool()); |
361 |
|
currentThread.interrupt(); |
368 |
– |
assertTrue(currentThread.isInterrupted()); |
362 |
|
assertNull(f.join()); |
363 |
|
assertTrue(Thread.interrupted()); |
364 |
|
assertEquals(21, f.result); |
366 |
|
|
367 |
|
f = fibActions[1]; |
368 |
|
currentThread.interrupt(); |
376 |
– |
assertTrue(currentThread.isInterrupted()); |
369 |
|
try { |
370 |
|
f.join(); |
371 |
|
shouldThrow(); |
376 |
|
|
377 |
|
f = fibActions[2]; |
378 |
|
currentThread.interrupt(); |
387 |
– |
assertTrue(currentThread.isInterrupted()); |
379 |
|
try { |
380 |
|
f.join(); |
381 |
|
shouldThrow(); |
388 |
|
|
389 |
|
f = fibActions[3]; |
390 |
|
currentThread.interrupt(); |
400 |
– |
assertTrue(currentThread.isInterrupted()); |
391 |
|
f.quietlyJoin(); |
392 |
|
assertTrue(Thread.interrupted()); |
393 |
|
assertEquals(21, f.result); |
395 |
|
|
396 |
|
f = fibActions[4]; |
397 |
|
currentThread.interrupt(); |
408 |
– |
assertTrue(currentThread.isInterrupted()); |
398 |
|
f.quietlyJoin(); |
399 |
|
assertTrue(Thread.interrupted()); |
400 |
|
checkCancelled(f); |
401 |
|
|
402 |
|
f = fibActions[5]; |
403 |
|
currentThread.interrupt(); |
415 |
– |
assertTrue(currentThread.isInterrupted()); |
404 |
|
f.quietlyJoin(); |
405 |
|
assertTrue(Thread.interrupted()); |
406 |
|
assertTrue(f.getException() instanceof FJException); |