title: C++11: why does std::condition_variable use std::unique_lock?
body: <p>I am a bit confused about the role of <code>std::unique_lock</code> when working with <code>std::condition_variable</code>. As far as I understood the <a href="http://en.cppreference.com/w/cpp/thread/unique_lock">documentation</a>, <code>std::unique_lock</code> is basically a bloated lock guard, with the possibility to swap the state between two locks.</p>
  
  <p>I've so far used <code>pthread_cond_wait(pthread_cond_t *cond, pthread_mutex_t *mutex)</code> for this purpose (I guess that's what the STL uses on posix). It takes a mutex, not a lock.</p>
  
  <p>What's the difference here? Is the fact that <code>std::condition_variable</code> deals with <code>std::unique_lock</code> an optimization? If so, how exactly is it faster?</p>