Use a BlockingQueue instead of a custom queue.