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

Comparing jsr166/src/main/java/util/concurrent/LinkedTransferQueue.java (file contents):
Revision 1.89 by dl, Thu Jun 11 16:23:03 2015 UTC vs.
Revision 1.90 by jsr166, Sat Jun 13 16:52:11 2015 UTC

# Line 733 | Line 733 | public class LinkedTransferQueue<E> exte
733  
734      /**
735       * Returns the first unmatched node of the given mode, or null if
736 <     * none.  Used by methods isEmpty, hasWaitingConsumer.
736 >     * none.  Used by hasWaitingConsumer.
737       */
738      private Node firstOfMode(boolean isData) {
739          for (Node p = head; p != null; p = succ(p)) {
# Line 1426 | Line 1426 | public class LinkedTransferQueue<E> exte
1426       * @return {@code true} if this queue contains no elements
1427       */
1428      public boolean isEmpty() {
1429 <        for (Node p = head; p != null; p = succ(p)) {
1430 <            if (!p.isMatched())
1431 <                return !p.isData;
1432 <        }
1433 <        return true;
1429 >        return firstDataNode() == null;
1430      }
1431  
1432      public boolean hasWaitingConsumer() {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines