http://thisthread.blogspot.com/2013/08/condition-variable-on-queue.html