Lines Matching refs:next

115      * ("prev") and successor ("next") nodes:
117 * class Node<E> { volatile Node<E> prev, next; volatile E item; }
126 * "last" node terminating any chain of next references starting at
131 * next reference in the first or last node to a fresh node
138 * A "self-link" is a next or prev reference that is the same node:
139 * p.prev == p or p.next == p
146 * (p.prev == null && p.next != p) ||
147 * (p.next == null && p.prev != p)
170 * any time, the set of live nodes maintained by prev and next
171 * links are identical, that is, the live nodes found via next
195 * prev and next pointers with special values that are interpreted
218 * The actual representation we use is that p.next == p means to
220 * pointers from head), and p.next == null && p.prev == p means
225 * p.next == null as the termination condition. When we need to
232 * follow next pointers ("forward" direction).
253 * with p.prev == null && p.next != p) can be reached in O(1) time.
258 * - (tmp = head).next != tmp || tmp != head
268 * with p.next == null && p.prev != p) can be reached in O(1) time.
270 * - the last node is always O(1) reachable from tail via next links
295 volatile Node<E> next;
344 (k.getDeclaredField("next"));
366 else if (p.next == p) // PREV_TERMINATOR
394 if ((q = p.next) != null &&
395 (q = (p = q).next) != null)
412 // Lost CAS race to another thread; re-read next
429 final Node<E> next = x.next;
431 unlinkFirst(x, next);
432 } else if (next == null) {
442 // following a sequence of either next or prev pointers.
452 // tail/head, before setting x's prev/next links to their
467 if (p.next == p)
480 for (Node<E> p = next; ; ++hops) {
486 Node<E> q = p.next;
515 (activePred.next == activeSucc) &&
518 (isLast ? activeSucc.next == null : activeSucc.item != null)) {
533 private void unlinkFirst(Node<E> first, Node<E> next) {
535 // assert next != null;
537 for (Node<E> o = null, p = next, q;;) {
538 if (p.item != null || (q = p.next) == null) {
539 if (o != null && p.prev != p && first.casNext(next, p)) {
542 (p.next == null || p.item != null) &&
573 if (o != null && p.next != p && last.casPrev(prev, p)) {
575 if (last.next == null &&
577 p.next == last) {
639 while ((t = tail).item == null && (p = t.next) != null) {
641 if ((q = p.next) == null ||
642 (q = (p = q).next) == null) {
672 if (p.next == p)
686 } while (x.item != null || x.next == null);
692 Node<E> next = x.next;
693 // assert next != null;
696 Node<E> p = next;
701 Node<E> q = p.next;
714 if (next == p || x.casNext(next, p))
721 * Returns the successor of p, or the first node if p.next has been
727 Node<E> q = p.next;
743 * p.prev == null && p.next != p
768 * p.next == null && p.prev != p
776 if ((q = p.next) != null &&
777 (q = (p = q).next) != null)
1178 if ((q = p.next) != null &&
1179 (q = (p = q).next) != null)
1195 if (last.next == null)
1200 // Lost CAS race to another thread; re-read next
1316 * the following next() call even if it was in the process of
1322 * Node returned by most recent call to next. Needed by remove.
1335 * Sets nextNode and nextItem to next valid node, or to null
1362 public E next() {
1455 PREV_TERMINATOR.next = PREV_TERMINATOR;