码迷,mamicode.com
首页 > 编程语言 > 详细

使用新线程并停止之前的线程

时间:2018-12-19 15:36:29      阅读:179      评论:0      收藏:0      [点我收藏+]

标签:stop   void   线程   oid   vat   new   使用   ...   null   

checkAndStopWorkingThread();
workingThread = new Thread() {
public void run() {
......
}

;
};
workingThread.start();



private void checkAndStopWorkingThread() {
if (workingThread != null) {
workingThread.stop();
workingThread = null;
}
}

使用新线程并停止之前的线程

标签:stop   void   线程   oid   vat   new   使用   ...   null   

原文地址:https://www.cnblogs.com/dongbo-2018/p/10142895.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!