mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
more responsive checkCanceled
This commit is contained in:
@@ -51,7 +51,7 @@ public abstract class ProgressIndicatorProvider {
|
||||
};
|
||||
}
|
||||
|
||||
public static boolean ourNeedToCheckCancel = false;
|
||||
public static volatile boolean ourNeedToCheckCancel = false;
|
||||
public static void checkCanceled() throws ProcessCanceledException {
|
||||
// smart optimization! There's a thread started in ProgressManagerImpl, that set's this flag up once in 10 milliseconds
|
||||
if (ourNeedToCheckCancel && ourInstance != null) {
|
||||
|
||||
@@ -60,7 +60,7 @@ public abstract class ProgressManager {
|
||||
|
||||
public abstract ProgressIndicator getProgressIndicator();
|
||||
|
||||
protected static boolean ourNeedToCheckCancel = false;
|
||||
protected static volatile boolean ourNeedToCheckCancel = false;
|
||||
public static void checkCanceled() throws ProcessCanceledException {
|
||||
// smart optimization! There's a thread started in ProgressManagerImpl, that set's this flag up once in 10 milliseconds
|
||||
if (ourNeedToCheckCancel) {
|
||||
|
||||
@@ -527,12 +527,6 @@ public class ProgressManagerImpl extends ProgressManager implements Disposable{
|
||||
((ProgressManagerImpl)getInstance()).dispose();
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
public static void setNeedToCheckCancel(boolean needToCheckCancel) {
|
||||
ourNeedToCheckCancel = needToCheckCancel;
|
||||
ProgressIndicatorProvider.ourNeedToCheckCancel = true;
|
||||
}
|
||||
|
||||
@TestOnly
|
||||
@SuppressWarnings({"UnusedDeclaration"})
|
||||
public static String isCanceledThread(Thread thread) {
|
||||
|
||||
Reference in New Issue
Block a user