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.145 by jsr166, Mon Jan 16 00:57:48 2017 UTC vs.
Revision 1.146 by jsr166, Mon Jan 16 01:05:41 2017 UTC

# Line 678 | Line 678 | public class LinkedTransferQueue<E> exte
678          // assert tail != null;
679          // assert s.isData == haveData;
680          for (Node t = tail, p = t;;) {        // move p to last node and append
681 <            Node n, u;                        // temps for reads of next & tail
681 >            Node n;
682              if (p.cannotPrecede(haveData))
683                  return null;                  // lost race vs opposite mode
684              else if ((n = p.next) != null)    // not last; keep traversing
685 <                p = p != t && t != (u = tail) ? (t = u) : // stale tail
685 >                p = (p != t && t != (t = tail)) ? t : // stale tail
686                      (p != n) ? n : head;      // restart if off list
687              else if (!p.casNext(null, s))
688                  p = p.next;                   // re-read on CAS failure

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines