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.129 by jsr166, Thu Dec 29 07:30:28 2016 UTC vs.
Revision 1.130 by jsr166, Thu Dec 29 07:54:02 2016 UTC

# Line 579 | Line 579 | public class LinkedTransferQueue<E> exte
579      private E xfer(E e, boolean haveData, int how, long nanos) {
580          if (haveData && (e == null))
581              throw new NullPointerException();
582 +        Node s = null;                        // the node to append, if needed
583  
584          restartFromHead: for (;;) {
585              for (Node h = head, p = h; p != null;) { // find & match first node
# Line 608 | Line 609 | public class LinkedTransferQueue<E> exte
609              }
610  
611              if (how != NOW) {                 // No matches available
612 <                Node s = new Node(e);
612 >                if (s == null)
613 >                    s = new Node(e);
614                  Node pred = tryAppend(s, haveData);
615                  if (pred == null)
616                      continue restartFromHead; // lost race vs opposite mode

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines