RFR: 8323782: Race: Thread::interrupt vs. AbstractInterruptibleChannel.begin [v2]

Alan Bateman alanb at openjdk.org
Thu Jan 18 08:35:15 UTC 2024


On Thu, 18 Jan 2024 08:02:27 GMT, David Holmes <dholmes at openjdk.org> wrote:

> It is really safe/correct to move this outside the synchronized block? I know things have changed a bit with loom but we've "always" held a lock when doing the actual interrupt. I'd have to check the VM logic to be sure it can be called concurrently from multiple threads for the same target thread.

This hasn't changed. The interruptLock is used to coordinate the add/remove of the nioBlocker. When there is no nioBlocker set then the interrupt status and unparking (as in JavaThread::interrupt) executes without the interruptLock.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/17444#discussion_r1457092058


More information about the core-libs-dev mailing list