Thread.isAlive() can be used in java to determine whether the thread is running, Thread.IsAlive property indicates whether the thread is currently available, if the thread has been started , and if there is currently no exception, it is true, otherwise it is false. (Recommended: java video tutorial)
/** * 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()
For more java knowledge, please pay attention to the java basic tutorial column.
The above is the detailed content of Java determines whether a thread is running. For more information, please follow other related articles on the PHP Chinese website!