RFR: 8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock [v2]
Alan Bateman
alanb at openjdk.org
Mon Jan 8 09:04:58 UTC 2024
On Fri, 5 Jan 2024 17:28:30 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> src/java.base/share/classes/java/nio/channels/spi/AbstractInterruptibleChannel.java line 180:
>>
>>> 178: Thread me = Thread.currentThread();
>>> 179: if (me.isInterrupted()) {
>>> 180: interruptor.interrupt(me);
>>
>> The new javadoc comment on `Interruptor.interrupt(Thread)` states that "This method is invoked while holding the Thread's interrupt lock.", which isn't the case when being invoked from here.
>
> This is an internal interface, I can re-phrase the method description to make it clear that this is when Thread.interrupt is called.
I've update the method descriptions in sun.nio.ch.Interruptible and hopefully it is a bit clearer now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17219#discussion_r1444309663
More information about the core-libs-dev
mailing list