Merge pull request #19220 from akka/wip-19216-forward-port-RK
=act #19216 Fix AbstractNodeQueue nepotism
This commit is contained in:
commit
f77fd82b10
1 changed files with 3 additions and 9 deletions
|
|
@ -74,18 +74,11 @@ public abstract class AbstractNodeQueue<T> extends AtomicReference<AbstractNodeQ
|
|||
|
||||
/*
|
||||
* Use this method only from the consumer thread!
|
||||
*
|
||||
* !!! There is a copy of this code in pollNode() !!!
|
||||
*/
|
||||
public final T poll() {
|
||||
final Node<T> next = peekNode();
|
||||
final Node<T> next = pollNode();
|
||||
if (next == null) return null;
|
||||
else {
|
||||
final T ret = next.value;
|
||||
next.value = null;
|
||||
Unsafe.instance.putOrderedObject(this, tailOffset, next);
|
||||
return ret;
|
||||
}
|
||||
else return next.value;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -106,6 +99,7 @@ public abstract class AbstractNodeQueue<T> extends AtomicReference<AbstractNodeQ
|
|||
tail.value = next.value;
|
||||
next.value = null;
|
||||
Unsafe.instance.putOrderedObject(this, tailOffset, next);
|
||||
tail.setNext(null);
|
||||
return tail;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue