code: private static boolean shouldParkAfterFailedAcquire(Node pred, Node node) {
          int ws = pred.waitStatus;
          if (ws == Node.SIGNAL)
              /*
               * This node has already set status asking a release
               * to signal it, so it can safely park.
               */
              return true;
          if (ws > 0) {
              /*
               * Predecessor was cancelled. Skip over predecessors and
               * indicate retry.
               */
              do {
                  node.prev = pred = pred.prev;
              } while (pred.waitStatus > 0);
              pred.next = node;
          } else {
              /*
               * waitStatus must be 0 or PROPAGATE.  Indicate that we
               * need a signal, but don't park yet.  Caller will need to
               * retry to make sure it cannot acquire before parking.
               */
              pred.compareAndSetWaitStatus(ws, Node.SIGNAL);
          }
          return false;
      }
docs: Checks and updates status for a node that failed to acquire.
  Returns true if thread should block. This is the main signal
  control in all acquire loops.  Requires that pred == node.prev.
  
  @param pred node's predecessor holding status
  @param node the node
  @return {@code true} if thread should block