title: Is Boost Thread's boost::unique_lock a scoped lock?
body: <p>I understand that variable locked by a <code>boost::mutex::scoped_lock</code> is automatically unlocked when it is out of scope.</p>
  
  <p>How about <code>boost::unique_lock</code>, does it automatically unlock the variable when it is out of scope?</p>
  
  <p>Can anyone also point a reference for that feature as well.</p>
  
  <pre><code>double x;
  boost::mutex x_mutex;
  
  void foo() 
  {
      {
           boost::unique_lock&lt;boost::mutex&gt; lock(x_mutex);
           x = rand();
      }    
      ...... some calculation which takes 10 second ......
      ...... is x still locked here??? ......    
  }
  </code></pre>
  
  <p>Thanks.</p>