摘要: 1.常见停止方式 结束run函数,run中含退出标志位。 使用interrupt()方法中断线程 使用stop方法暴力终止(已经弃用) 2.结束run 调用testThread.stopThread就可以了。 使用场景无限制 3.使用interrupt()方法 3.1示例 3.1使用场景 适合线程处 阅读全文
posted @ 2017-10-04 15:50 f9q 阅读(454) 评论(0) 推荐(0)
摘要: 转自 : http://docs.oracle.com/javase/1.5.0/docs/guide/misc/threadPrimitiveDeprecation.html 1.Why is Thread.stop deprecated? Because it is inherently uns 阅读全文
posted @ 2017-10-04 13:47 f9q 阅读(450) 评论(0) 推荐(0)