PriorityBlockingQueue(带优先级的阻塞队列)

BlockingQueue   A Queue that additionally supports operations that wait for the queue to become non-empty when retrieving an element, and wait for space to become available in the queue when storing an element.

one of the implementation is use ReentrantLock  and   Condition.await

the priority property implemented by reorder  the element according use  the comparator that will be used to order this priority queue. If null, the natural ordering of the elements will be used.

原文地址:https://www.cnblogs.com/jianglijs/p/7484709.html