6979009: (fc) FileChannel.read() fails to throw ClosedByInterruptException
Chris Hegarty
chris.hegarty at oracle.com
Tue Nov 9 08:40:18 PST 2010
OK, thanks Alan. I'm fine with the change.
-Chris.
Alan Bateman wrote:
> Chris Hegarty wrote:
>> :
>> It seems unnecessary (but not wrong) to pass the current thread to the
>> interruptor in AbstractSelector, null would be sufficient.
> Yes, null would do too but it really doesn't matter because it's not
> used for this case.
>
>>
>> Would it be overkill/wrong to have a list of interrupted threads?
>> Instead of just the last interrupted thread getting
>> ClosedByInterruptException.
> It's only possible to close the channel once and only one thread should
> throw ClosedByInterruptException. If several threads doing I/O on the
> same channel are interrupted at around the same time then first thread,
> calling Thread.interrupt, to acquite clockLock will set the victim and
> it's that thread that will throw ClosedByInterruptException. To the
> other threads its just like an asynchronous close, irrespective of if
> they have been interrupted too.
>
> -Alan.
>
>
More information about the nio-dev
mailing list