thread-safe keyed priority queue.