title: How can you ensure in java that a block of code can not be interrupted by any other thread
body: <p>exampl:</p>
  
  <pre><code>new Thread(new Runnable() {
    public void run() {
      while(condition) {
  
        *code that must not be interrupted*
  
        *some more code*
      }
    }
  }).start();
  
  SomeOtherThread.start();
  
  YetAntherThread.start();
  </code></pre>
  
  <p>How can you ensure that <em>code that must not be interrupted</em> won't be interrupted?</p>