title: Java - How to know when thread is waiting?
body: <p>Is there any neat solution of knowing when a thread has been put into <code>wait</code> status? I am putting threads to <code>wait</code> and I <code>notify</code> 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.</p>
  
  <p>I could probably set a flag myself to true/false. But I can't imagine there is a better way to do this?</p>