Geir Magnusson Jr wrote: > Given that you are blocked, why is it in an unknown state?
The problem is that you typically don't know whether the thread is actually blocked or not. So if it is really blocked then, yes, interrupting it may leave the channel safe for future operations, but if it were blocked and then you interrupted it just after it awoke and was reading/writing data then who knows what state you have left the OS in. Since different OS'es behave differently to interrupting IO operations in-flight then saying the channel is invalidated by interruptions is the safe option. (Note that if you interrupt a thread that is nowhere near a channel operation the thread will be marked as interrupted, and if it should go on to attempt a Channel operation then it causes the channel to be closed! D'oh!) > Doesn't the channel know that it didn't complete what > it was trying to do? Yep, it gets the exception thrown that shows things were interrupted. Regards, Tim -- Tim Ellison ([EMAIL PROTECTED]) IBM Java technology centre, UK. --------------------------------------------------------------------- Terms of use : http://incubator.apache.org/harmony/mailing.html To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
