RFR: 8322829: Refactor nioBlocker to avoid blocking while holding Thread's interrupt lock
Jaikiran Pai
jpai at openjdk.org
Fri Jan 5 17:33:23 UTC 2024
On Tue, 2 Jan 2024 10:21:11 GMT, Alan Bateman <alanb at openjdk.org> 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 107:
> 105: public void postInterrupt() {
> 106: try {
> 107: AbstractInterruptibleChannel.this.close();
Before the current change, the `Interruptible` implementation in this class used to call `AbstractInterruptibleChannel.this.implCloseChannel();` whereas now it calls `close()`. Is that an intentional change?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17219#discussion_r1443152626
More information about the core-libs-dev
mailing list