In Java, how do you determine if a thread is running?

后端 未结 10 2188
-上瘾入骨i
-上瘾入骨i 2020-11-28 11:30

How do you determine if a thread is running?

10条回答
  •  -上瘾入骨i
    2020-11-28 12:09

    You can use: Thread.currentThread().isAlive();. Returns true if this thread is alive; false otherwise.

提交回复
热议问题