void (@NotNull ProgressIndicator progress) { synchronized (threadsUnderIndicator) { Collection<Thread> threads = threadsUnderIndicator.get(progress); Thread other = threads == null || threads.isEmpty() ? null : threads.iterator().next(); if (other != null) { if (other == Thread.currentThread()) { LOG.error("This thread is already running under this indicator, starting/stopping it here might be a data race"); } else { StringWriter stackTrace = new StringWriter(); ThreadDumper.dumpCallStack(other, stackTrace, other.getStackTrace()); LOG.error("Other (" + other +") is already running under this indicator (" + progress+ ", " + progress.getClass() + "), starting/stopping it here might be a data race.\n" + "Consider using com.intellij.openapi.progress.ProgressManager.executeProcessUnderProgress\n" + "The other stack trace:\n" + stackTrace); } } } }