A thread is interrupted only if someone called the interrupt () method of this thread, and not because when you started your thread, you think some other random exception was thrown.
When the threadrupted () method is called, an InterruptedException will be thrown into the thread if the thread is in the middle of a blocking operation (for example, reading IO).
When an InterruptedException is thrown, you should know that the interrupted status is cleared, so the next time you call isInterrupted () in your thread, you will get false (even if you just cauth InterruptedException)
Keep this in mind when encoding your streams. And if you donβt understand what Iβm talking about, stop multithreading coding and read some books about concurrency in java.
David Hofmann Apr 08 '14 at 13:26 2014-04-08 13:26
source share