title: Thread stop and synchronization
body: <p>I'm reading a book which says not to use such a code:</p>
  
  <pre><code>private volatile Thread myThread;
  
  ....
  
  myThread.stop();
  </code></pre>
  
  <p>Instead one should use:</p>
  
  <pre><code>if (myThread != null ) {
  
   Thread dummy = myThread;
  
   myThread = null;
  
   dummy.interrupt();
  
  
  }
  </code></pre>
  
  <p>Unfortunately the subject is not elaborated any further... Could someone explain me this?</p>