title: pthread_cond_wait versus semaphore
body: <p>What are the pros / cons of using <code>pthread_cond_wait</code> or using a semaphore ?
  I am waiting for a state change like this :</p>
  
  <pre><code>pthread_mutex_lock(&amp;cam-&gt;video_lock);
  while(cam-&gt;status == WAIT_DISPLAY) {
      pthread_cond_wait(&amp;cam-&gt;video_cond, &amp;cam-&gt;video_lock);
  }
  pthread_mutex_unlock(&amp;cam-&gt;video_lock);
  </code></pre>
  
  <p>Using a properly initialised semaphore, I think I could do it like this :</p>
  
  <pre><code>while(cam-&gt;status == WAIT_DISPLAY) {
      sem_wait(&amp;some_semaphore);
  }
  </code></pre>
  
  <p>What are the pros and cons of each method ?</p>