NOT_INTERRUPTIBLE OpenOption and how that should fit with InterruptibleChannel

Bruno Ploumhans bruno.ploumhans at gmail.com
Thu Dec 26 10:15:18 UTC 2024


Hi,

I opened a PR that adds StandardOpenOptions.NOT_INTERRUPTIBLE to
expose and supersede FileChannelImpl#setUninterruptible. However, this
needs more discussion because FileChannel implements
InterruptibleChannel.

Here are some thoughts to kick-start the discussion:
- The documentation of InterruptibleChannel does not currently account
for implementations that might not be interruptible. Same for the
documentation of Thread.interrupt(). That needs changing.
- Alan suggested in previous discussion (2018) a new `boolean
isInterruptible()` method.
- I wonder if the ability to pass a `boolean uninterruptible` flag
should be exposed in AbstractUninterruptibleChannel, or if that should
be kept an implementation detail of FileChannelImpl.

In any case, I am happy to experiment with various solutions.

Best,
Bruno

my PR: https://github.com/openjdk/jdk/pull/22882
previous discussion (2018):
https://mail.openjdk.org/pipermail/nio-dev/2018-February/004756.html


More information about the nio-dev mailing list