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.90 by jsr166, Sat Jun 13 16:52:11 2015 UTC vs.
Revision 1.91 by jsr166, Sat Jun 13 17:06:03 2015 UTC

# Line 749 | Line 749 | public class LinkedTransferQueue<E> exte
749       * self-linked before using.
750       */
751      final Node firstDataNode() {
752 <        for (Node p = head; p != null;) {
753 <            Object item = p.item;
754 <            if (p.isData) {
755 <                if (item != null && item != p)
756 <                    return p;
752 >        restartFromHead: for (;;) {
753 >            for (Node p = head; p != null;) {
754 >                Object item = p.item;
755 >                if (p.isData) {
756 >                    if (item != null && item != p)
757 >                        return p;
758 >                }
759 >                else if (item == null)
760 >                    break;
761 >                if (p == (p = p.next))
762 >                    continue restartFromHead;
763              }
764 <            else if (item == null)
759 <                break;
760 <            if (p == (p = p.next))
761 <                p = head;
764 >            return null;
765          }
763        return null;
766      }
767  
768      /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines