code: private Node tryAppend(Node s, boolean haveData) {
          for (Node t = tail, p = t;;) {        // move p to last node and append
              Node n, u;                        // temps for reads of next & tail
              if (p == null && (p = head) == null) {
                  if (casHead(null, s))
                      return s;                 // initialize
              }
              else if (p.cannotPrecede(haveData))
                  return null;                  // lost race vs opposite mode
              else if ((n = p.next) != null)    // not last; keep traversing
                  p = p != t && t != (u = tail) ? (t = u) : // stale tail
                      (UNLINKED != n) ? n : null; // restart if off list
              else if (!p.casNext(null, s))
                  p = p.next;                   // re-read on CAS failure
              else {
                  if (p != t) {                 // update if slack now >= 2
                      while ((tail != t || !casTail(t, s)) &&
                             (t = tail)   != null &&
                             (s = t.next) != null && // advance and retry
                             (s = s.next) != null && s != UNLINKED);
                  }
                  return p;
              }
          }
      }
docs: Tries to append node s as tail.
  
  @param s the node to append
  @param haveData true if appending in data mode
  @return null on failure due to losing race with append in
  different mode, else s's predecessor, or s itself if no
  predecessor