code: final int awaitJoin(WorkQueue w, ForkJoinTask<?> task, long deadline) {
          int s = 0;
          if (w != null) {
              ForkJoinTask<?> prevJoin = w.currentJoin;
              if (task != null && (s = task.status) >= 0) {
                  w.currentJoin = task;
                  CountedCompleter<?> cc = (task instanceof CountedCompleter) ?
                      (CountedCompleter<?>)task : null;
                  for (;;) {
                      if (cc != null)
                          helpComplete(w, cc, 0);
                      else
                          helpStealer(w, task);
                      if ((s = task.status) < 0)
                          break;
                      long ms, ns;
                      if (deadline == 0L)
                          ms = 0L;
                      else if ((ns = deadline - System.nanoTime()) <= 0L)
                          break;
                      else if ((ms = TimeUnit.NANOSECONDS.toMillis(ns)) <= 0L)
                          ms = 1L;
                      if (tryCompensate(w)) {
                          task.internalWait(ms);
                          U.getAndAddLong(this, CTL, AC_UNIT);
                      }
                      if ((s = task.status) < 0)
                          break;
                  }
                  w.currentJoin = prevJoin;
              }
          }
          return s;
      }
docs: Helps and/or blocks until the given task is done or timeout.
  
  @param w caller
  @param task the task
  @param deadline for timed waits, if nonzero
  @return task status on exit