code: public static void invokeAll(ForkJoinTask<?> t1, ForkJoinTask<?> t2) {
          int s1, s2;
          t2.fork();
          if ((s1 = t1.doInvoke() & DONE_MASK) != NORMAL)
              t1.reportException(s1);
          if ((s2 = t2.doJoin() & DONE_MASK) != NORMAL)
              t2.reportException(s2);
      }
docs: Forks the given tasks, returning when {@code isDone} holds for
  each task or an (unchecked) exception is encountered, in which
  case the exception is rethrown. If more than one task
  encounters an exception, then this method throws any one of
  these exceptions. If any task encounters an exception, the
  other may be cancelled. However, the execution status of
  individual tasks is not guaranteed upon exceptional return. The
  status of each task may be obtained using {@link
  #getException()} and related methods to check if they have been
  cancelled, completed normally or exceptionally, or left
  unprocessed.
  
  <p>This method may be invoked only from within {@code
  ForkJoinPool} computations (as may be determined using method
  {@link #inForkJoinPool}).  Attempts to invoke in other contexts
  result in exceptions or errors, possibly including {@code
  ClassCastException}.
  
  @param t1 the first task
  @param t2 the second task
  @throws NullPointerException if any task is null