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.144 by jsr166, Sun Jan 15 01:16:22 2017 UTC vs.
Revision 1.145 by jsr166, Mon Jan 16 00:57:48 2017 UTC

# Line 679 | Line 679 | public class LinkedTransferQueue<E> exte
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
682 <            if (p == null)
683 <                p = head;
684 <            else if (p.cannotPrecede(haveData))
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
686 <                    (p != n) ? n : null;      // restart if off list
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
689              else {

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines