RFR: 8365065: cancelled ForkJoinPool tasks no longer throw CancellationException [v2]
Viktor Klang
vklang at openjdk.org
Mon Sep 22 19:01:31 UTC 2025
On Mon, 22 Sep 2025 16:56:24 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Viktor Klang has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update src/java.base/share/classes/java/util/concurrent/ForkJoinTask.java
>>
>> Co-authored-by: Chen Liang <liach at openjdk.org>
>
> test/jdk/java/util/concurrent/tck/ForkJoinPoolTest.java line 516:
>
>> 514:
>> 515: private void assertCancellationExceptionFrom(
>> 516: ExecutorService e,
>
> I don't think "e" is needed.
Good catch!
> test/jdk/java/util/concurrent/tck/ForkJoinPoolTest.java line 524:
>
>> 522: try {
>> 523: t.set(Thread.currentThread());
>> 524: c.await();
>
> Using CountDownLatch is a bit subtle here, maybe a Thread.sleep(Duration.ofDays(1)) might be clearer. It doesn't matter what indefinite wait is used but for the CountDownLatch::await then it might need a comment as readers will look around for the call to countDown.
I'll add a comment.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27430#discussion_r2369898251
PR Review Comment: https://git.openjdk.org/jdk/pull/27430#discussion_r2369891595
More information about the core-libs-dev
mailing list