How to check if a thread is sleeping?

后端 未结 5 501
旧时难觅i
旧时难觅i 2020-12-17 17:13

Is there any way to check if a given thread is sleeping?

5条回答
  •  庸人自扰
    2020-12-17 18:04

    I am not sure if there is a better way but you could change a variable when a thread goes to sleep and check that variable if the thread is sleeping or not.

提交回复
热议问题