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.
------------- Commit messages: - Initial commit Changes: https://git.openjdk.org/jdk/pull/17219/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17219&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8322829 Stats: 141 lines in 6 files changed: 87 ins; 25 del; 29 mod Patch: https://git.openjdk.org/jdk/pull/17219.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/17219/head:pull/17219 PR: https://git.openjdk.org/jdk/pull/17219