Home | History | Annotate | Download | only in concurrent

Lines Matching defs:PREV

114      * ("prev") and successor ("next") nodes:
116 * class Node<E> { volatile Node<E> prev, next; volatile E item; }
123 * prev reference that terminates any chain of prev references
129 * A new element is added atomically by CASing the null prev or
137 * A "self-link" is a next or prev reference that is the same node:
138 * p.prev == p or p.next == p
145 * (p.prev == null && p.next != p) ||
146 * (p.next == null && p.prev != p)
151 * following prev pointers from head; likewise for tail. However,
169 * any time, the set of live nodes maintained by prev and next
172 * prev links from the last node. However, this is not true for
194 * prev and next pointers with special values that are interpreted
218 * goto the first node (which in turn is reached by following prev
219 * pointers from head), and p.next == null && p.prev == p means
252 * with p.prev == null && p.next != p) can be reached in O(1) time.
254 * - the first node is always O(1) reachable from head via prev links
267 * with p.next == null && p.prev != p) can be reached in O(1) time.
292 volatile Node<E> prev;
320 U.putOrderedObject(this, PREV, val);
324 return U.compareAndSwapObject(this, PREV, cmp, val);
330 private static final long PREV;
336 PREV = U.objectFieldOffset
337 (Node.class.getDeclaredField("prev"));
357 if ((q = p.prev) != null &&
358 (q = (p = q).prev) != null)
375 // Lost CAS race to another thread; re-read prev
394 else if (p.prev == p) // NEXT_TERMINATOR
423 final Node<E> prev = x.prev;
425 if (prev == null) {
428 unlinkLast(x, prev);
437 // following a sequence of either next or prev pointers.
447 // tail/head, before setting x's prev/next links to their
454 for (Node<E> p = prev; ; ++hops) {
460 Node<E> q = p.prev;
483 if (p.prev == p)
511 (activeSucc.prev == activePred) &&
512 (isFirst ? activePred.prev == null : activePred.item != null) &&
534 if (o != null && p.prev != p && first.casNext(next, p)) {
536 if (first.prev == null &&
538 p.prev == first) {
562 private void unlinkLast(Node<E> last, Node<E> prev) {
564 // assert prev != null;
566 for (Node<E> o = null, p = prev, q;;) {
567 if (p.item != null || (q = p.prev) == null) {
568 if (o != null && p.next != p && last.casPrev(prev, p)) {
571 (p.prev == null || p.item != null) &&
604 while ((h = head).item == null && (p = h.prev) != null) {
606 if ((q = p.prev) == null ||
607 (q = (p = q).prev) == null) {
656 Node<E> prev = x.prev;
657 // assert prev != null;
660 Node<E> p = prev;
665 Node<E> q = p.prev;
678 if (prev == p || x.casPrev(prev, p))
698 if (p.prev == p)
712 } while (x.item != null || x.prev == null);
727 * Returns the predecessor of p, or the last node if p.prev has been
732 Node<E> q = p.prev;
738 * p.prev == null && p.next != p
746 if ((q = p.prev) != null &&
747 (q = (p = q).prev) != null)
763 * p.next == null && p.prev != p
1183 else if (p.prev == p) // NEXT_TERMINATOR
1618 NEXT_TERMINATOR.prev = NEXT_TERMINATOR;