public static void checkCancelled() {
    ThreadContext.warnAccidentalCancellation();
    Job currentJob = currentJob();
    if (currentJob != null) {
      try {
        ensureActive(currentJob);
      }
      catch (ProcessCanceledException pce) {
        throw pce;
      }
      catch (CancellationException e) {
        throw new CeProcessCanceledException(e);
      }
    }
  }
public static void checkCancelled()