title: Multiple wait on the same lock
body: <p>I am a bit confused about locking. Specifically, this code here from wikipedia about the consumer producer problem.</p>
  
  <p><a href="http://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem#Example_in_C.2B.2B" rel="nofollow">http://en.wikipedia.org/wiki/Producer%E2%80%93consumer_problem#Example_in_C.2B.2B</a></p>
  
  <p>What happened if there are more than 1 producer wait to add to the queue? If consumer consumed some job from the queue and issues a notification to indicate the queue is not full, they all try to push a job in the queue, that would require queue.push method to be thread safe. Since they could all modify queue, this code could break. Am I missing something? </p>