docs: private Object registerWaiter(Object waiter, Executor executor) {
          assert !(waiter instanceof UnblockableThread) : "Waiting for response on this thread is illegal";
          WaitNode waitNode = null;
          for (; ; ) {
              final Object oldState = state;
              if (isDone(oldState)) {
                  return oldState;
              }
  
              Object newState;
              if (oldState == VOID && (executor == null || executor == defaultExecutor)) {
                  // nothing is syncing on this future, so instead of creating a WaitNode, we just try to cas the waiter
                  newState = waiter;
              } else {
                  // something already has been registered for syncing, so we need to create a WaitNode
                  if (waitNode == null) {
                      waitNode = new WaitNode(waiter, executor);
                  }
                  waitNode.next = oldState;
                  newState = waitNode;
              }
  
              if (compareAndSetState(oldState, newState)) {
                  // we have successfully registered
                  return VOID;
              }
          }
      }