关于while (!Thread.currentThread().isInterrupted()){}的意思
来源:互联网 发布:百战天下坐骑进阶数据 编辑:程序博客网 时间:2024/05/22 11:43
在Java代码中常常看到这个代码:
while (!Thread.currentThread().isInterrupted()){ ... ...}
这是什么意思呢?
Thread.currentThread()返回当前线程对象引用
.isInterrupted()测试是否当前线程已被中断 中断返回true,否则返回false
总的说,这句就是无限判断当前线程状态,如果没有中断,就一直执行while内容。
0 0
- 关于while (!Thread.currentThread().isInterrupted()){}的意思
- Thread.currentThread().isInterrupted()
- 玩转java多线程学习篇四 Thread类的常用API之currentThread,isAlive,sleep,interrupt,isInterrupted,stop
- 关于thread中interupt,interrupted,isInterrupted的一些个人总结
- 深入研究Thread的currentThread()
- Thread.interrupted()与Thread.isInterrupted()的区别
- Thread.currentThread()、isAlive()、Thread.sleep()的使用
- 多线程中this、Thread.currentThread()和this.currentThread()的区别
- Thread的interrupt、isInterrupted、interrupted源码探索
- Thread类的interrupt(),interrupted(),isInterrupted()
- 关于 VC9,VC6,Thread Safe,Non Thread Safe的意思
- Thread.currentThread()与this的区别
- ClassLoader,Thread.currentThread().setContextClassLoader,tomcat的ClassLoader
- this和Thread.currentThread的区别
- Thread.currentThread()与this的区别
- Thread.currentThread()与this的区别
- Thread.sleep() 和Thread.currentThread().sleep()的区别
- Thread.sleep() 和Thread.currentThread().sleep()的区别
- 程序员软件项目预估的宝贵经验
- android创建桌面图标
- Jquery 操作获取 radio选中值
- neutron-l3-agent
- Android之IntentService搭配LocalBroadcast
- 关于while (!Thread.currentThread().isInterrupted()){}的意思
- HTML,CSS,font-family:中文字体的英文名称 (宋体 微软雅黑)
- 基于sae平台的servlet建立微信企业号问题总结
- Swift语法基础:1 - Swift的简单介绍
- 运气巧合与吹牛
- jQuery插件总结
- iOS crash 崩溃问题的追踪方法
- 关于字符串前的L或_T
- ios--Crash log符号化与调试信息