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.70 by jsr166, Mon Jun 23 23:04:42 2014 UTC vs.
Revision 1.71 by dl, Thu Aug 21 11:35:15 2014 UTC

# Line 680 | Line 680 | public class LinkedTransferQueue<E> exte
680                  @SuppressWarnings("unchecked") E itemE = (E) item;
681                  return itemE;
682              }
683 <            if ((w.isInterrupted() || (timed && nanos <= 0)) &&
684 <                    s.casItem(e, s)) {        // cancel
685 <                unsplice(pred, s);
686 <                return e;
683 >            else if (w.isInterrupted() || (timed && nanos <= 0)) {
684 >                 unsplice(pred, s);           // try to unlink and cancel
685 >                 if (s.casItem(e, s))         // return normally if lost CAS
686 >                     return e;
687              }
688 <
689 <            if (spins < 0) {                  // establish spins at/near front
688 >            else if (spins < 0) {            // establish spins at/near front
689                  if ((spins = spinsFor(pred, s.isData)) > 0)
690                      randomYields = ThreadLocalRandom.current();
691              }
# Line 1023 | Line 1022 | public class LinkedTransferQueue<E> exte
1022       * @param s the node to be unspliced
1023       */
1024      final void unsplice(Node pred, Node s) {
1025 <        s.forgetContents(); // forget unneeded fields
1025 >        s.waiter = null; // disable signals
1026          /*
1027           * See above for rationale. Briefly: if pred still points to
1028           * s, try to unlink s.  If s cannot be unlinked, because it is

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines