Java - How to know when thread is waiting?
2022-09-01 14:10:12
Is there any neat solution of knowing when a thread has been put into status? I am putting threads to and I them when i need it. But sometimes I want to know if a thread is currently waiting, and if so, I have to do something else.wait
wait
notify
I could probably set a flag myself to true/false. But I can't imagine there is a better way to do this?