docs: @FFDCIgnore(Throwable.class)
      void run() {
          final boolean trace = TraceComponent.isAnyTracingEnabled();
  
          if (!state.setRunning()) {
              if (trace && tc.isDebugEnabled())
                  Tr.debug(this, tc, "unable to run", state.get());
              nsRunEnd = System.nanoTime();
              if (callback != null)
                  callback.onEnd(task, this, null, true, 0, null); // aborted, queued task will never run
              return;
          }
  
          boolean aborted = true;
          Object callbackContext = null;
          thread = Thread.currentThread();
          try {
              if (callback == null)
                  aborted = false;
              else {
                  callbackContext = callback.onStart(task, this);
                  aborted = state.get() == CANCELED;
              }
  
              if (aborted)
                  nsRunEnd = System.nanoTime();
              else {
                  T t;
                  if (callable == null) {
                      runnable.run();
                      t = predefinedResult;
                  } else {
                      t = callable.call();
                  }
  
                  nsRunEnd = System.nanoTime();
  
                  if (result.compareAndSet(state, t)) {
                      state.releaseShared(SUCCESSFUL);
                      if (latch != null)
                          latch.countDown(t);
                  } else if (Integer.valueOf(CANCELED).equals(result.get())) {
                      if (trace && tc.isDebugEnabled())
                          Tr.debug(this, tc, "canceled during/after run");
                      // Prevent dirty read of state during onEnd before the canceling thread transitions the state to CANCELING/CANCELED
                      while (state.get() == RUNNING)
                          Thread.yield();
                  }
  
                  if (trace && tc.isDebugEnabled())
                      Tr.debug(this, tc, "run", t);
              }
  
              if (callback != null)
                  try {
                      callback.onEnd(task, this, callbackContext, aborted, 0, null);
                  } catch (Throwable x) {
                  }
          } catch (Throwable x) {
              if (trace && tc.isDebugEnabled())
                  Tr.debug(this, tc, "run", x);
  
              nsRunEnd = System.nanoTime();
  
              if (result.compareAndSet(state, x)) {
                  state.releaseShared(aborted ? ABORTED : FAILED);
                  if (latch != null)
                      latch.countDown();
              }
  
              if (callback != null)
                  callback.onEnd(task, this, callbackContext, aborted, 0, x);
          } finally {
              thread = null;
              // Prevent accidental interrupt of subsequent operations by awaiting the transition from CANCELING to CANCELED
              while (state.get() == CANCELING)
                  Thread.yield();
          }
      }