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

Comparing jsr166/src/jsr166y/LinkedTransferQueue.java (file contents):
Revision 1.1 by dl, Tue May 29 09:55:32 2007 UTC vs.
Revision 1.3 by dl, Mon Aug 27 19:48:36 2007 UTC

# Line 39 | Line 39 | import java.io.*;
39   * <a href="{@docRoot}/../technotes/guides/collections/index.html">
40   * Java Collections Framework</a>.
41   *
42 < * @since 1.5
42 > * @since 1.7
43   * @author Doug Lea
44   * @param <E> the type of elements held in this collection
45   *
# Line 584 | Line 584 | public class LinkedTransferQueue<E> exte
584              }
585          }
586      }
587 +
588 +    public boolean isEmpty() {
589 +        for (;;) {
590 +            QNode h = traversalHead();
591 +            QNode p = h.next;
592 +            if (p == null)
593 +                return true;
594 +            Object x = p.get();
595 +            if (p != x) {
596 +                if (!p.isData)
597 +                    return true;
598 +                if (x != null)
599 +                    return false;
600 +            }
601 +        }
602 +    }
603  
604      public boolean hasWaitingConsumer() {
605          for (;;) {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines