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

Comparing jsr166/src/main/java/util/concurrent/ConcurrentLinkedDeque.java (file contents):
Revision 1.72 by jsr166, Mon Jun 13 15:31:25 2016 UTC vs.
Revision 1.73 by dl, Fri Jun 17 13:03:45 2016 UTC

# Line 332 | Line 332 | public class ConcurrentLinkedDeque<E>
332                          // Successful CAS is the linearization point
333                          // for e to become an element of this deque,
334                          // and for newNode to become "live".
335 <                        if (p != t) // hop two nodes at a time
336 <                            TAIL.compareAndSet(this, t, newNode);  // Failure OK.
335 >                        if (p != t) // hop two nodes at a time; failure is OK
336 >                            TAIL.weakCompareAndSetVolatile(this, t, newNode);
337                          return;
338                      }
339                      // Lost CAS race to another thread; re-read next
# Line 1124 | Line 1124 | public class ConcurrentLinkedDeque<E>
1124                      if (NEXT.compareAndSet(p, null, beginningOfTheEnd)) {
1125                          // Successful CAS is the linearization point
1126                          // for all elements to be added to this deque.
1127 <                        if (!TAIL.compareAndSet(this, t, last)) {
1127 >                        if (!TAIL.weakCompareAndSetVolatile(this, t, last)) {
1128                              // Try a little harder to update tail,
1129                              // since we may be adding many elements.
1130                              t = tail;
1131                              if (last.next == null)
1132 <                                TAIL.compareAndSet(this, t, last);
1132 >                                TAIL.weakCompareAndSetVolatile(this, t, last);
1133                          }
1134                          return true;
1135                      }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines