ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/PriorityBlockingQueue.java (file contents):
Revision 1.6 by dl, Tue Jun 24 14:34:48 2003 UTC vs.
Revision 1.7 by dl, Tue Jul 1 16:29:52 2003 UTC

# Line 17 | Line 17 | public class PriorityBlockingQueue<E> ex
17          implements BlockingQueue<E>, java.io.Serializable {
18  
19      private final PriorityQueue<E> q;
20 <    private final FairReentrantLock lock = new FairReentrantLock();
20 >    //    private final FairReentrantLock lock = new FairReentrantLock();
21 >    private final ReentrantLock lock = new ReentrantLock();
22      private final Condition notEmpty = lock.newCondition();
23  
24      /**
# Line 72 | Line 73 | public class PriorityBlockingQueue<E> ex
73          q = new PriorityQueue<E>(initialElements);
74      }
75  
76 +    /**
77 +     * Returns the comparator associated with this priority queue, or
78 +     * <tt>null</tt> if it uses its elements' natural ordering.
79 +     *
80 +     * @return the comparator associated with this priority queue, or
81 +     *         <tt>null</tt> if it uses its elements' natural ordering.
82 +     */
83 +    public Comparator comparator() {
84 +        return q.comparator();
85 +    }
86 +
87      public boolean offer(E x) {
88          if (x == null) throw new NullPointerException();
89          lock.lock();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines