您的位置 首页 java

java判断线程是否运行

java中可以使用Thread.isAlive()判断线程是否运行,Thread.IsAlive属性 ,表示该线程当前是否为可用状态,如果线程已经启动,并且当前没有任何异常的话,则是true,否则为false。(推荐:java视频教程)

/*** Tests if this thread is alive. A thread is alive if it has* been started and has not yet died.* @return <code>true</code> if this thread is alive;* <code>false</code> otherwise.*/Thread.isAlive()

文章来源:智云一二三科技

文章标题:java判断线程是否运行

文章地址:https://www.zhihuclub.com/15121.shtml

关于作者: 智云科技

热门文章

网站地图