七叶笔记 » java编程 » 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()

相关文章