title: Why does mutex try_lock return false even when you own the mutex?
body: <p>Consider this simple code:</p>
  
  <pre><code>boost::mutex m;
  m.lock();
  bool locked = m.try_lock();
  std::cout&lt;&lt; (!locked? "Can't use lock" : "Can use lock.")&lt;&lt;std::endl;
  system("pause");
  </code></pre>
  
  <p>The code print's <code>Can't use lock</code>. This is a problem, because in my program, I need to perform an asynchronous operation <strong>only if the thread has exclusive rights to the lock</strong>. So:</p>
  
  <ol>
  <li>Why does try_lock return false when I own that mutex?</li>
  <li>How do I create a code block that is only executed by the thread that owns the lock?</li>
  </ol>