Thursday, 15 September 2011

multithreading - Java - How to know when thread is waiting? -


There is no clear solution to know if a thread has been placed in the wait position ? I'm putting the thread to wait and I'm going to notification when I need it but sometimes I want to know that a thread is currently waiting, and If so, then I have to do something else.

I could probably set myself a true / false flag. But I can not imagine that there is a better way to do this?

method getState () thread.state of a thread < / Code> which can be:

View new, running, blocked, waiting, time-d-witting or suspended


No comments:

Post a Comment