=act #19216 Fix AbstractNodeQueue nepotism

This commit is contained in:
Björn Antonsson 2015-12-17 12:09:38 +01:00 committed by Roland Kuhn
parent 8dbade7131
commit a43d323d3c

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