title: Why should wait() always be called inside a loop
body: <p>I have read that we should always call a <code>wait()</code> from within a loop:</p>
  
  <pre><code>while (!condition) { obj.wait(); }
  </code></pre>
  
  <p>It works fine without a loop so why is that?</p>