On Tue, 2 Jan 2024 10:21:11 GMT, Alan Bateman <[email protected]> wrote:
> In preparation for when virtual threads can unmount while holding a monitor
> or unmount when blocking on monitorenter, the implementation of
> VirtualThread's interrupt method is refactored to avoid parking/blocking
> while holding the Thread's interrupt lock. The implementations of
> sun.nio.ch.Interruptible are refactored to close/wakeup the
> InterruptibleChannel/Selector after releasing the interrupt lock. There is a
> lot of test coverage for async close and interrupt, no additional tests are
> added.
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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17219#discussion_r1443147621