mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8162108: Rename weakCompareAndSetVolatile to weakCompareAndSet
Reviewed-by: martin
This commit is contained in:
parent
c073edc24c
commit
3bd5ebe2ef
57 changed files with 1363 additions and 1338 deletions
|
@ -308,7 +308,7 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
|
|||
// for e to become an element of this queue,
|
||||
// and for newNode to become "live".
|
||||
if (p != t) // hop two nodes at a time; failure is OK
|
||||
TAIL.weakCompareAndSetVolatile(this, t, newNode);
|
||||
TAIL.weakCompareAndSet(this, t, newNode);
|
||||
return true;
|
||||
}
|
||||
// Lost CAS race to another thread; re-read next
|
||||
|
@ -477,7 +477,7 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
|
|||
|
||||
next = succ(p);
|
||||
if (pred != null && next != null) // unlink
|
||||
NEXT.weakCompareAndSetVolatile(pred, p, next);
|
||||
NEXT.weakCompareAndSet(pred, p, next);
|
||||
if (removed)
|
||||
return true;
|
||||
}
|
||||
|
@ -524,12 +524,12 @@ public class ConcurrentLinkedQueue<E> extends AbstractQueue<E>
|
|||
if (NEXT.compareAndSet(p, null, beginningOfTheEnd)) {
|
||||
// Successful CAS is the linearization point
|
||||
// for all elements to be added to this queue.
|
||||
if (!TAIL.weakCompareAndSetVolatile(this, t, last)) {
|
||||
if (!TAIL.weakCompareAndSet(this, t, last)) {
|
||||
// Try a little harder to update tail,
|
||||
// since we may be adding many elements.
|
||||
t = tail;
|
||||
if (last.next == null)
|
||||
TAIL.weakCompareAndSetVolatile(this, t, last);
|
||||
TAIL.weakCompareAndSet(this, t, last);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue