247 |
|
} |
248 |
|
|
249 |
|
/** |
250 |
< |
* join/quietlyJoin of a forked task ignores interrupts |
250 |
> |
* join/quietlyJoin of a forked task succeeds in the presence of interrupts |
251 |
|
*/ |
252 |
|
public void testJoinIgnoresInterrupts() { |
253 |
|
RecursiveAction a = new CheckedRecursiveAction() { |
258 |
|
assertSame(f, f.fork()); |
259 |
|
Thread.currentThread().interrupt(); |
260 |
|
assertNull(f.join()); |
261 |
< |
assertTrue(Thread.interrupted()); |
261 |
> |
Thread.interrupted(); |
262 |
|
assertEquals(21, f.result); |
263 |
|
checkCompletedNormally(f); |
264 |
|
|
270 |
|
f.join(); |
271 |
|
shouldThrow(); |
272 |
|
} catch (CancellationException success) { |
273 |
< |
assertTrue(Thread.interrupted()); |
273 |
> |
Thread.interrupted(); |
274 |
|
checkCancelled(f); |
275 |
|
} |
276 |
|
|
282 |
|
f.join(); |
283 |
|
shouldThrow(); |
284 |
|
} catch (FJException success) { |
285 |
< |
assertTrue(Thread.interrupted()); |
285 |
> |
Thread.interrupted(); |
286 |
|
checkCompletedAbnormally(f, success); |
287 |
|
} |
288 |
|
|
291 |
|
assertSame(f, f.fork()); |
292 |
|
Thread.currentThread().interrupt(); |
293 |
|
f.quietlyJoin(); |
294 |
< |
assertTrue(Thread.interrupted()); |
294 |
> |
Thread.interrupted(); |
295 |
|
assertEquals(21, f.result); |
296 |
|
checkCompletedNormally(f); |
297 |
|
|
300 |
|
assertSame(f, f.fork()); |
301 |
|
Thread.currentThread().interrupt(); |
302 |
|
f.quietlyJoin(); |
303 |
< |
assertTrue(Thread.interrupted()); |
303 |
> |
Thread.interrupted(); |
304 |
|
checkCancelled(f); |
305 |
|
|
306 |
|
f.reinitialize(); |
308 |
|
assertSame(f, f.fork()); |
309 |
|
Thread.currentThread().interrupt(); |
310 |
|
f.quietlyJoin(); |
311 |
< |
assertTrue(Thread.interrupted()); |
311 |
> |
Thread.interrupted(); |
312 |
|
checkCompletedAbnormally(f, f.getException()); |
313 |
|
}}; |
314 |
|
testInvokeOnPool(mainPool(), a); |