From 2b7ea6176cd6cf300472f6eda66ad0c76b36e4c3 Mon Sep 17 00:00:00 2001 From: peter Date: Sat, 27 Feb 2016 12:42:21 +0100 Subject: [PATCH] honor user-defined value of "ide.prioritize.ui.thread" option --- .../intellij/openapi/progress/impl/CoreProgressManager.java | 3 ++- platform/util/resources/misc/registry.properties | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java index 6cc781ed8637..c288bf564767 100644 --- a/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java +++ b/platform/core-impl/src/com/intellij/openapi/progress/impl/CoreProgressManager.java @@ -54,7 +54,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable { private final AtomicInteger myCurrentModalProgressCount = new AtomicInteger(0); private static final boolean ENABLED = !"disabled".equals(System.getProperty("idea.ProcessCanceledException")); - private static final boolean ourMaySleepInCheckCanceled = Registry.is("ide.prioritize.ui.thread", false); + private static boolean ourMaySleepInCheckCanceled; private ScheduledFuture myCheckCancelledFuture; // guarded by threadsUnderIndicator // indicator -> threads which are running under this indicator. guarded by threadsUnderIndicator. @@ -504,6 +504,7 @@ public class CoreProgressManager extends ProgressManager implements Disposable { } private static void updateShouldCheckCanceled() { + ourMaySleepInCheckCanceled = Registry.is("ide.prioritize.ui.thread", false); if (ourMaySleepInCheckCanceled && HeavyProcessLatch.INSTANCE.hasPrioritizedThread()) { shouldCheckCanceled = true; return; diff --git a/platform/util/resources/misc/registry.properties b/platform/util/resources/misc/registry.properties index 0a477a3e9d12..8897c5c772b4 100644 --- a/platform/util/resources/misc/registry.properties +++ b/platform/util/resources/misc/registry.properties @@ -716,7 +716,7 @@ idea.io.safe.sync=true idea.io.safe.sync.description=When "Safe Write" is enabled, sync() is invoked after the last write to flush data to disk ide.prioritize.ui.thread=false -ide.prioritize.ui.thread.description=In presence of UI activity, deprioritizes all other threads for the activity to complete ASAP. Changing requires restart. +ide.prioritize.ui.thread.description=In presence of UI activity, deprioritizes all other threads for the activity to complete ASAP ide.require.transaction.for.model.changes=false ide.require.transaction.for.model.changes.description=Whether write action can only happen under TransactionGuard