Lines Matching defs:prev

115      * ("prev") and successor ("next") nodes:
117 * class Node<E> { volatile Node<E> prev, next; volatile E item; }
124 * prev reference that terminates any chain of prev references
130 * A new element is added atomically by CASing the null prev or
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)
152 * following prev pointers from head; likewise for tail. However,
170 * any time, the set of live nodes maintained by prev and next
173 * prev links from the last node. However, this is not true for
195 * prev and next pointers with special values that are interpreted
219 * goto the first node (which in turn is reached by following prev
220 * pointers from head), and p.next == null && p.prev == p means
253 * with p.prev == null && p.next != p) can be reached in O(1) time.
255 * - the first node is always O(1) reachable from head via prev links
268 * with p.next == null && p.prev != p) can be reached in O(1) time.
293 volatile Node<E> prev;
340 (k.getDeclaredField("prev"));
361 if ((q = p.prev) != null &&
362 (q = (p = q).prev) != null)
379 // Lost CAS race to another thread; re-read prev
399 else if (p.prev == p) // NEXT_TERMINATOR
428 final Node<E> prev = x.prev;
430 if (prev == null) {
433 unlinkLast(x, prev);
442 // following a sequence of either next or prev pointers.
452 // tail/head, before setting x's prev/next links to their
459 for (Node<E> p = prev; ; ++hops) {
465 Node<E> q = p.prev;
488 if (p.prev == p)
516 (activeSucc.prev == activePred) &&
517 (isFirst ? activePred.prev == null : activePred.item != null) &&
539 if (o != null && p.prev != p && first.casNext(next, p)) {
541 if (first.prev == null &&
543 p.prev == first) {
567 private void unlinkLast(Node<E> last, Node<E> prev) {
569 // assert prev != null;
571 for (Node<E> o = null, p = prev, q;;) {
572 if (p.item != null || (q = p.prev) == null) {
573 if (o != null && p.next != p && last.casPrev(prev, p)) {
576 (p.prev == null || p.item != null) &&
609 while ((h = head).item == null && (p = h.prev) != null) {
611 if ((q = p.prev) == null ||
612 (q = (p = q).prev) == null) {
661 Node<E> prev = x.prev;
662 // assert prev != null;
665 Node<E> p = prev;
670 Node<E> q = p.prev;
683 if (prev == p || x.casPrev(prev, p))
703 if (p.prev == p)
717 } while (x.item != null || x.prev == null);
732 * Returns the predecessor of p, or the last node if p.prev has been
737 Node<E> q = p.prev;
743 * p.prev == null && p.next != p
751 if ((q = p.prev) != null &&
752 (q = (p = q).prev) != null)
768 * p.next == null && p.prev != p
1183 else if (p.prev == p) // NEXT_TERMINATOR
1457 NEXT_TERMINATOR.prev = NEXT_TERMINATOR;