title: pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed
body: <p>I received that error:</p>
  
  <blockquote>
    <p>pthread_mutex_lock.c:62: __pthread_mutex_lock: Assertion `mutex->_<em>data.</em>_owner == 0' failed.</p>
  </blockquote>
  
  <p>And I cannot found any cause of that. However I'm not sure about the following piece of code:</p>
  
  <p>Declarations:</p>
  
  <pre><code>std::mutex lock;
  std::condition_variable cond;
  </code></pre>
  
  <p>Sequence of locks &amp; unlocks:</p>
  
  <pre><code>std::unique_lock&lt;std::mutex&gt; lk(lock);
  
  cond.wait(lk);
  
  lock.unlock();
  </code></pre>
  
  <p>If I remove this sequence - everything works fine, but without any protection. I'm not sure if I use <code>unique_lock</code> properly.</p>