Lock around queue, conditionally wait if queue is full