Home > Java > JavaBase > body text

Java determines whether a thread is running

Release: 2019-12-30 14:15:16
Original
4233 people have browsed it

Java determines whether a thread is running

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()
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template