code: private void unlinkFirst(Node<E> first, Node<E> next) {
          // assert first != null;
          // assert next != null;
          // assert first.item == null;
          for (Node<E> o = null, p = next, q;;) {
              if (p.item != null || (q = p.next) == null) {
                  if (o != null && p.prev != p && first.casNext(next, p)) {
                      skipDeletedPredecessors(p);
                      if (first.prev == null &&
                          (p.next == null || p.item != null) &&
                          p.prev == first) {
  
                          updateHead(); // Ensure o is not reachable from head
                          updateTail(); // Ensure o is not reachable from tail
  
                          // Finally, actually gc-unlink
                          o.lazySetNext(sentinel());
                          o.lazySetPrev(prevTerminator());
                      }
                  }
                  return;
              }
              else if (sentinel() == q) // j2objc: q == p.next == sentinel means node GC-unlinked
                  return;
              else {
                  o = p;
                  p = q;
              }
          }
      }
docs: Unlinks non-null first node.