title: Why use Thread.currentThread().isInterrupted() with try/ catch
body: <p>I have found this structure popular in the multithreading chapter of <em>Thinking in java</em>:</p>
  
  <pre><code>public void run(){
      try{
          while(!Thread.currentThread().isInterrupted()){
              // do something blocked like wait(), sleep() or I/O
          }
      }catch(InterruptedExeption e){
  
      }
  }
  </code></pre>
  
  <p>However I think now that the while loop will exit if and only if the blocked <code>wait()</code>, <code>sleep()</code> or <code>I/O</code> throws <code>InterruptedExeption</code>, why not use <code>while(true)</code> instead? Or just because the <code>Thread.currentThread().isInterrupted()</code> is just canonical?</p>