Lines Matching defs:Node

124      * - There is exactly one (last) Node with a null next reference,
125 * which is CASed when enqueueing. This last Node can be
131 * reference of a Node to null atomically removes it from the
134 * head to advance. A dequeued Node may remain in use
139 * from a predecessor dequeued Node. That would cause two problems:
142 * a Node was tenured while live, which generational GCs have a
147 * linking a Node that has just been dequeued to itself. Such a
160 * CASing a Node's item reference to null atomically removes the
168 * When constructing a Node (before enqueuing it) we avoid paying
173 * Both head and tail may or may not point to a Node with a
176 * Node with null item. Both head and tail are only updated using
181 private static class Node<E> {
183 volatile Node<E> next;
190 static <E> Node<E> newNode(E item) {
191 Node<E> node = new Node<E>();
196 static <E> boolean casItem(Node<E> node, E cmp, E val) {
200 static <E> void lazySetNext(Node<E> node, Node<E> val) {
204 static <E> boolean casNext(Node<E> node, Node<E> cmp, Node<E> val) {
220 transient volatile Node<E> head;
234 private transient volatile Node<E> tail;
253 Node<E> h = null, t = null;
255 Node<E> newNode = newNode(Objects.requireNonNull(e));
287 final void updateHead(Node<E> h, Node<E> p) {
298 final Node<E> succ(Node<E> p) {
299 Node<E> next = p.next;
311 final Node<E> newNode = newNode(Objects.requireNonNull(e));
313 for (Node<E> t = tail, p = t;;) {
314 Node<E> q = p.next;
342 for (Node<E> h = head, p = h, q;;) {
367 for (Node<E> h = head, p = h, q;;) {
389 Node<E> first() {
392 for (Node<E> h = head, p = h, q;;) {
434 for (Node<E> p = first(); p != null;) {
455 for (Node<E> p = first(); p != null; p = succ(p)) {
477 Node<E> next, pred = null;
478 for (Node<E> p = first(); p != null; pred = p, p = next) {
517 Node<E> beginningOfTheEnd = null, last = null;
519 Node<E> newNode = newNode(Objects.requireNonNull(e));
531 for (Node<E> t = tail, p = t;;) {
532 Node<E> q = p.next;
566 for (Node<E> p = first(); p != null;) {
592 for (Node<E> p = first(); p != null;) {
692 private Node<E> nextNode;
703 * Node of the last returned item, to support remove.
705 private Node<E> lastRet;
709 Node<E> h, p, q;
732 final Node<E> pred = nextNode;
738 for (Node<E> p = succ(pred), q;; p = q) {
752 Node<E> l = lastRet;
775 for (Node<E> p = first(); p != null; p = succ(p)) {
797 Node<E> h = null, t = null;
800 Node<E> newNode = newNode((E) item);
818 Node<E> current; // current node; null until initialized
826 Node<E> p;
855 Node<E> p;
872 Node<E> p;
922 private boolean casTail(Node<E> cmp, Node<E> val) {
926 private boolean casHead(Node<E> cmp, Node<E> val) {
944 (Node.class.getDeclaredField("item"));
946 (Node.class.getDeclaredField("next"));