void (@NotNull ProgressIndicator indicator) { // mark threads running under this indicator as canceled synchronized (threadsUnderIndicator) { Set<Thread> threads = threadsUnderIndicator.get(indicator); if (threads != null) { for (Thread thread : threads) { boolean underCancelledIndicator = false; for (ProgressIndicator currentIndicator = getCurrentIndicator(thread); currentIndicator != null; currentIndicator = currentIndicator instanceof WrappedProgressIndicator ? ((WrappedProgressIndicator)currentIndicator).getOriginalProgressIndicator() : null) { if (currentIndicator == indicator) { underCancelledIndicator = true; break; } } if (underCancelledIndicator) { threadsUnderCanceledIndicator.add(thread); updateShouldCheckCanceled(); } } } } }