title: when main thread exits from thread join method
body: <p>I am reading java thread source code, there is a little problem I am not sure.
  there are two thread, main thread and work thread which is a long time consumed thread, I want main thread to wait until work thread dies, so I call join method on work thread, in Thread source code, main thread waits when work thread is alive:</p>
  
  <pre><code> while (isAlive()) {
              wait(0);
          }
  </code></pre>
  
  <p>when work thread completes work and dies, so what happens to main thread now? does it notified by thread scheduler by calling notifyAll method on work thread automatically?</p>