I believe that sleep, and other blocking operations will throw an
interruptedexception when interrupted. Keep that in mind.
I've tried the interrupt before while I was doing long blocking IO
operations. It didn't work, I realized, because I was handling the
exception as an IOException and retrying
Very true, Nathan.
When calling cancel(true), an interrupt is 'called' on the thread. This
means that methods that put the thread into a wait-state (wait, sleep and
such) get interrupted and these will throw an interrupted-exception. Some
(not all!) blocking IO operation may get interrupted as
2 matches
Mail list logo