title: Where to catch InterruptedException for Object.wait() with synchronized block?
body: <p>As I understand this is very common snippet for multithreading in Java.</p>
  
  <pre><code>boolean loaded = false;
  Object lock = new Object();
  
  public void block() {
      synchronized (lock) {
          while(!loaded)
              lock.wait(); // Unhandled exception type InterruptedException
      }
  }
  </code></pre>
  
  <p>and in another thread</p>
  
  <pre><code>public void done () {
      synchronized (lock) {
          loaded = true;
          lock.notify();
      }
  }
  </code></pre>
  
  <p><strong>But I am not sure where I should put try and catch, I can surround whole synchronized block or only <code>lock.wait()</code>? What is rule of thumb and does it really matter?</strong></p>
  
  <p>For handling is it okay to call <code>Thread.currentThread().interrupt()</code> in this situation?</p>