1. 当线程处于Blocked状态(sleep,wait,join),线程会退出阻塞状态,并抛出一个InterruptedException。park除外,它有响应但是不会抛出异常

2. 当线程处于Running状态,只是线程的interrupt标记被设置为true,线程本身的运行不会受到任何影响。

上面说得其实还不是特别准确,Java 1.8的Thread.interrupt()方法的注释如下,这个应该是最为权威准确的

Unless the current thread is interrupting itself, which is always permitted, the checkAccess method of this thread is invoked, which may cause a SecurityException to be thrown.
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.
If this thread is blocked in an I/O operation upon an InterruptibleChannel then the channel will be closed, the thread's interrupt status will be set, and the thread will receive a java.nio.channels.ClosedByInterruptException.
If this thread is blocked in a java.nio.channels.Selector then the thread's interrupt status will be set and it will return immediately from the selection operation, possibly with a non-zero value, just as if the selector's wakeup method were invoked.
If none of the previous conditions hold then this thread's interrupt status will be set.
Interrupting a thread that is not alive need not have any effect.

最新文章

  1. hdu 1166
  2. Oracle 客户端连接服务器[转]
  3. 关于Android的布局
  4. 03-图片浏览器(plist的简单应用)
  5. iOS-MVVM--备用
  6. Object-C变量作用域 -- 笔记
  7. C# 向批处理文件输入字符
  8. 2017Unity开发者大会备受关注的原因有哪些?
  9. P4014 分配问题 网络流
  10. linux安装nodejs运行vue程序
  11. SILK 预测模块分析
  12. ELK 日志学习
  13. Sublime Text 3中SublimeLinter的使用
  14. Linux线程编程之信号处理
  15. PAT 1103 Integer Factorization[难]
  16. LeetCode 318. Maximum Product of Word Lengths (状态压缩)
  17. vue2.0 keep-alive 最佳实战(转载)
  18. Unix 网络编程 读书笔记1
  19. Luogu3387 缩点 【tarjan】【DP】
  20. Go中处理文本格式

热门文章

  1. L1-043 阅览室 (20 分)
  2. spring-data-mongodb
  3. Oracle 学习笔记(十)
  4. java第五次课堂笔记
  5. schema.xml属性概念
  6. struts OGNL详解
  7. iOS设备唯一标识(可以用版)
  8. 【Luogu】P4462异或序列(莫队)
  9. 抄书 Richard P. Stanley Enumerative Combinatorics Chapter 2 Sieve Methods
  10. 刷题总结——纸带(NOIP赛前模拟)