title: How to kill a thread that is waiting on synchronized resource?
body: <p>Suppose a class named <code>Prey</code> extends <code>Thread</code> and an Object of <code>Prey</code> named <code>deer</code> is in waiting state on a <code>synchronized</code> resource. Now I want to kill this <code>deer</code> by force which is in waiting state. Which one of the following is correct way to kill the <code>deer</code>.</p>
  
  <ol>
  <li><code>deer.interrupt();</code></li>
  <li><code>deer.notify();
   deer.interrupt();</code></li>
  <li><code>deer.notify();
   deer.killmeBoolean(true);</code></li>
  <li><code>deer.killmeBoolean(true);
   deer.notify();</code></li>
  </ol>
  
  <p>where <code>killmeBoolean(boolean)</code> is used to set a flag so that <code>deer</code> thread can be terminated from <code>while(flag)</code> loop.</p>