1. 当线程处于Blocked状态(sleep,wait,join),线程会退出阻塞状态,并抛出一个InterruptedException.park除外,它有响应但是不会抛出异常 2. 当线程处于Running状态,只是线程的interrupt标记被设置为true,线程本身的运行不会受到任何影响. 上面说得其实还不是特别准确,Java 1.8的Thread.interrupt()方法的注释如下,这个应该是最为权威准确的 Unless the current thread is interrup…
先看三个方法原型: public void interrupt(): public boolean isInterrupted(): public static boolean interrupted(): 一.先说interrupt()方法,看注释 Interrupts this thread. Unless the current thread is interrupting itself, which is always permitted, the checkAccess method…