void (@Nullable ProgressIndicator customIndicator) { //this is the cancellation check myIndicator.checkCanceled(); myIndicator.setIndeterminate(true); ProgressIndicator indicator = customIndicator == null ? myIndicator : customIndicator; indicator.checkCanceled(); beforeTask(); if (AppExecutorUtil.propagateContextOrCancellation() && myChildContext != null) { try (AccessToken ignored = ThreadContext.installThreadContext(myChildContext.getContext(), true)) { myChildContext.runAsCoroutine(() -> myTask.perform(indicator)); } } else { myTask.perform(indicator); } }