removed ourLockedCHeckedCOunter

This commit is contained in:
Alexey Kudravtsev
2015-04-27 15:09:26 +03:00
parent 20618f05fa
commit ffabf689e2
@@ -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;