线程调用t.interrupt();其实就是给线程设置一个中断状态的标识,并不能让线程马上终止。
If this thread is blocked in an invocation of the wait(), wait(long), or wait(long, int) methods of the Object class, or of the join(), join(long), join(long, int), sleep(long), or sleep(long, int), methods of this class, then its interrupt status will be cleared and it will receive an InterruptedException. 。
如果线程调用了wait ,jion, sleep方法而阻塞->>t.interrupt() -->将会抛出一个InterruptedExc......
阅读全文