Merge pull request #19220 from akka/wip-19216-forward-port-RK

=act #19216 Fix AbstractNodeQueue nepotism
This commit is contained in:
Roland Kuhn 2015-12-19 15:20:37 +01:00
commit f77fd82b10

View file

@ -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;
}
}