How to check if thread is terminated?

后端 未结 2 1296
感动是毒
感动是毒 2021-02-06 01:47

when does a thread reach the terminated status? Does it get terminated when the end of the run() method is reached?

So what is the right wa

2条回答
  •  感动是毒
    2021-02-06 02:09

    test the method thread.isAlive()

    ... or optionally, join until it finishes with thread.join()

提交回复
热议问题