code: int await(long time, TimeUnit unit) throws InterruptedException {
          int s = state.get();
          if (s == SUBMITTED || s == RUNNING && thread != Thread.currentThread()) {
              long nsGetBegin, maxWaitNS = unit.toNanos(time);
              if (s == RUNNING // already started
                  || nsStartBy == nsAcceptBegin - 1 // no start timeout
                  || nsStartBy - (nsGetBegin = System.nanoTime()) > maxWaitNS) { // remaining start timeout exceeds the requested max wait
                  if (state.tryAcquireSharedNanos(1, maxWaitNS))
                      s = state.get();
                  else
                      s = TIMEOUT;
              } else { // first wait for up to the start timeout
                  if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                      Tr.debug(this, tc, "await start timeout for " + (nsStartBy - nsGetBegin) + "ns");
                  state.tryAcquireSharedNanos(1, nsStartBy - nsGetBegin);
                  s = state.get();
                  if (s == SUBMITTED) { // attempt to abort the task
                      abort(true, new StartTimeoutException(getIdentifier(), getTaskName(), //
                                      System.nanoTime() - nsAcceptBegin, //
                                      nsStartBy - nsAcceptBegin));
                      s = state.get();
                  }
                  if (s == RUNNING) { // wait for the remainder of the timeout supplied to get
                      if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                          Tr.debug(this, tc, "await remainder of timeout");
                      if (state.tryAcquireSharedNanos(1, maxWaitNS - (System.nanoTime() - nsGetBegin)))
                          s = state.get();
                      else
                          s = TIMEOUT;
                  }
              }
          }
          return s;
      }
docs: Await completion of the future. Completion could be successful, exceptional, or by cancellation.
  
  @return either the state of the task after awaiting completion, or, if a TimeoutException would be raised by Future.get then the TIMEOUT constant.