title: Implementing a Priority queue with a Condition Variable in C
body: <p>My current understanding of condition variables is that all blocked (waiting) threads are inserted into a basic FIFO queue, the first item of which is awakened when signal() is called.</p>
  
  <p>Is there any way to modify this queue (or create a new structure) to perform as a priority queue instead?  I've been thinking about it for a while, but most solutions I have end up being hampered by the existing queue structure inherent to C.V.'s and mutexes.</p>
  
  <p>Thanks!</p>