mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Decrease latency before cancellation when multiple threads asking for checkCancelled concurrently.
This commit is contained in:
@@ -43,8 +43,8 @@ public abstract class ProgressManager {
|
||||
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) {
|
||||
ourNeedToCheckCancel = false;
|
||||
getInstance().doCheckCanceled();
|
||||
ourNeedToCheckCancel = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -85,7 +85,7 @@ public class ProgressManagerImpl extends ProgressManager {
|
||||
}
|
||||
else {
|
||||
ourLockedCheckCounter = 0;
|
||||
progress.checkCanceled();
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user