ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/main/java/util/concurrent/CompletableFuture.java
(Generate patch)

Comparing jsr166/src/main/java/util/concurrent/CompletableFuture.java (file contents):
Revision 1.203 by jsr166, Sun Jun 26 22:27:00 2016 UTC vs.
Revision 1.204 by jsr166, Sat Jul 2 21:32:31 2016 UTC

# Line 481 | Line 481 | public class CompletableFuture<T> implem
481          boolean unlinked = false;
482          Completion p;
483          while ((p = stack) != null && !p.isLive()) // ensure head of stack live
484 <            unlinked = STACK.compareAndSet(this, p, p.next);
485 <        if (p != null && !unlinked) {              // try to unlink first nonlive
484 >            unlinked = STACK.weakCompareAndSetVolatile(this, p, p.next);
485 >        if (p != null && !unlinked) {
486 >            // try to unlink first nonlive
487              for (Completion q = p.next; q != null;) {
488                  Completion s = q.next;
489                  if (q.isLive()) {
490                      p = q;
491                      q = s;
492 <                }
492 <                else {
493 <                    NEXT.compareAndSet(p, q, s);
492 >                } else if (NEXT.weakCompareAndSetVolatile(p, q, s))
493                      break;
494 <                }
494 >                else
495 >                    q = p.next;
496              }
497          }
498      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines