title: pthread condition loop
body: <p>The typical pattern I've seen for using pthread_cond_wait is:</p>
  
  <pre><code>pthread_mutex_lock(&amp;lock);
    while (!test)
      pthread_cond_wait(&amp;condition, &amp;lock);
  pthread_mutex_unlock(&amp;lock);
  </code></pre>
  
  <p>Why can't an if statement be used instead of a while loop.</p>
  
  <pre><code>pthread_mutex_lock(&amp;lock);
    if (!test)
      pthread_cond_wait(&amp;condition, &amp;lock);
  pthread_mutex_unlock(&amp;lock);
  </code></pre>