title: When is a condition variable needed, isn't a mutex enough?
body: <p>I'm sure mutex isn't enough that's the reason the concept of condition variables exist; but it beats me and I'm not able to convince myself with a concrete scenario when a condition variable is essential.</p>
  
  <p><a href="https://stackoverflow.com/questions/1055398/differences-between-conditional-variables-mutexes-and-locks">Differences between Conditional variables, Mutexes and Locks</a> question's accepted answer says that a condition variable is a </p>
  
  <blockquote>
    <p>lock with a "signaling" mechanism. It is used when threads need to
    wait for a resource to become available. A thread can "wait" on a CV
    and then the resource producer can "signal" the variable, in which
    case the threads who wait for the CV get notified and can continue
    execution</p>
  </blockquote>
  
  <p>Where I get confused is that, a thread can wait on a mutex too, and when it gets signalled, is simply means the variable is now available, why would I need a condition variable?</p>
  
  <p>P.S.: Also, a mutex is required to guard the condition variable anyway, when makes my vision more askew towards not seeing condition variable's purpose.</p>