Add support for waiting pop to the queue.