title: predicate for condition variable
body: <p>I am new to multi threading. While writing multi threaded code in C++11 using condition variable , I use the following construct</p>
  
  <pre><code>while(predicate) {
      cond_var.wait(&amp;lock);
  }
  </code></pre>
  
  <p>However, I have been reading Deitel's third edition book on operating systems(chp 6) where the following construct is being used</p>
  
  <pre><code>if(predicate) {
      cond_var.wait(&amp;lock);
  }
  </code></pre>
  
  <p>So, what's the difference? Why isn't the book using while? Isn't spurious call an issue?</p>