docs: void prepareShutdown() {
          int oldState, newState;
          do {
              oldState = state;
              if ((oldState & CLOSED) != 0) {
                  return;
              }
              newState = oldState | CLOSED;
          } while (!stateUpdater.compareAndSet(this, oldState, newState));
          // If there no active requests notify listeners directly
          if (newState == CLOSED) {
              handleCompleted();
          }
      }