mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
removed ourLockedCHeckedCOunter
This commit is contained in:
@@ -28,7 +28,6 @@ import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.ThrowableComputable;
|
||||
import com.intellij.openapi.wm.ex.ProgressIndicatorEx;
|
||||
import com.intellij.psi.PsiLock;
|
||||
import com.intellij.util.containers.ConcurrentLongObjectMap;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.SmartHashSet;
|
||||
@@ -53,8 +52,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable {
|
||||
final AtomicInteger myCurrentUnsafeProgressCount = new AtomicInteger(0);
|
||||
private final AtomicInteger myCurrentModalProgressCount = new AtomicInteger(0);
|
||||
|
||||
private static volatile int ourLockedCheckCounter = 0;
|
||||
private static final boolean DISABLED = "disabled".equals(System.getProperty("idea.ProcessCanceledException"));
|
||||
private static final boolean ENABLED = !"disabled".equals(System.getProperty("idea.ProcessCanceledException"));
|
||||
private final ScheduledFuture<?> myCheckCancelledFuture;
|
||||
|
||||
// indicator -> threads which are running under this indicator. guarded by this.
|
||||
@@ -94,25 +92,8 @@ public class CoreProgressManager extends ProgressManager implements Disposable {
|
||||
boolean thereIsCanceledIndicator = !threadsUnderCanceledIndicator.isEmpty();
|
||||
if (thereIsCanceledIndicator) {
|
||||
final ProgressIndicator progress = getProgressIndicator();
|
||||
if (progress != null) {
|
||||
try {
|
||||
progress.checkCanceled();
|
||||
}
|
||||
catch (ProcessCanceledException e) {
|
||||
if (DISABLED) {
|
||||
return;
|
||||
}
|
||||
if (Thread.holdsLock(PsiLock.LOCK)) {
|
||||
ourLockedCheckCounter++;
|
||||
if (ourLockedCheckCounter > 10) {
|
||||
ourLockedCheckCounter = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
ourLockedCheckCounter = 0;
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
if (progress != null && ENABLED) {
|
||||
progress.checkCanceled();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -326,7 +307,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable {
|
||||
|
||||
final Runnable process = new TaskRunnable(task, progressIndicator, continuation);
|
||||
|
||||
TaskContainer action = new TaskContainer(task) {
|
||||
Runnable action = new TaskContainer(task) {
|
||||
@Override
|
||||
public void run() {
|
||||
boolean canceled = false;
|
||||
|
||||
Reference in New Issue
Block a user