301 |
|
// for e to become an element of this deque, |
302 |
|
// and for newNode to become "live". |
303 |
|
if (p != h) // hop two nodes at a time; failure is OK |
304 |
< |
HEAD.weakCompareAndSetVolatile(this, h, newNode); |
304 |
> |
HEAD.weakCompareAndSet(this, h, newNode); |
305 |
|
return; |
306 |
|
} |
307 |
|
// Lost CAS race to another thread; re-read prev |
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; failure is OK |
336 |
< |
TAIL.weakCompareAndSetVolatile(this, t, newNode); |
336 |
> |
TAIL.weakCompareAndSet(this, t, newNode); |
337 |
|
return; |
338 |
|
} |
339 |
|
// Lost CAS race to another thread; re-read next |
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.weakCompareAndSetVolatile(this, t, last)) { |
1127 |
> |
if (!TAIL.weakCompareAndSet(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.weakCompareAndSetVolatile(this, t, last); |
1132 |
> |
TAIL.weakCompareAndSet(this, t, last); |
1133 |
|
} |
1134 |
|
return true; |
1135 |
|
} |