public static PriorityQueue<K> | synchronize(PriorityQueue<K> q, Object sync) Returns a synchronized priority queue backed by the specified priority queue, using an assigned object to synchronize.
Parameters: q - the priority queue to be wrapped in a synchronized priority queue. Parameters: sync - an object that will be used to synchronize the access to the priority queue. |