title: boost disable_interruption not preventing thread_interrupted
body: <p>I am trying to prevent interruption of a thread while it is in a particular scope. However, using <code>boost::this_thread::disable_interruption di()</code> does not seem to have any effect.</p>
  
  <pre><code>#include &lt;boost/thread.hpp&gt;
  #include &lt;iostream&gt;
  
  void worker() {
      std::cout &lt;&lt; "START" &lt;&lt; std::endl;
  
      for(;;) {
          {
              boost::this_thread::disable_interruption di();
              try {
                  boost::this_thread::sleep(boost::posix_time::seconds(1));
              }
              catch(boost::thread_interrupted &amp; e) {
                  assert( false );
              }
          }
  
          try {
              boost::this_thread::interruption_point();
          }
          catch(boost::thread_interrupted &amp; e) {
              break;
          }
  
      }
  
      std::cout &lt;&lt; "END" &lt;&lt; std::endl;
  }
  
  
  int main() {
      boost::thread thread(&amp;worker);
      thread.interrupt();
      thread.join();
  }
  </code></pre>
  
  <p>The documentation appears to imply that <code>boost::this_thread::sleep()</code> will not throw <code>boost::thread_interrupted</code> while <code>di</code> is in scope.</p>
  
  <p>What am I doing wrong?</p>