Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Gvozdev2012-04-16 16:57:18 -0400
committerAndrew Gvozdev2012-04-16 16:57:18 -0400
commitf21f43f622079c62f73cf991bef8f8b5813b24b4 (patch)
tree72105cf0db4c7980a7c23da753180c83efa7050a
parent8aed5c842713329cd08a9da2ca8c6ce77a663d73 (diff)
downloadorg.eclipse.cdt-f21f43f622079c62f73cf991bef8f8b5813b24b4.tar.gz
org.eclipse.cdt-f21f43f622079c62f73cf991bef8f8b5813b24b4.tar.xz
org.eclipse.cdt-f21f43f622079c62f73cf991bef8f8b5813b24b4.zip
bug 371797: Do serialization in background to avoid delays in UI
-rw-r--r--core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java
index 05cf3566a9..5b4970b5f7 100644
--- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java
+++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/language/settings/providers/LanguageSettingsProvidersSerializer.java
@@ -51,6 +51,7 @@ import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.ListenerList;
+import org.eclipse.core.runtime.OperationCanceledException;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.ILock;
import org.eclipse.core.runtime.jobs.ISchedulingRule;
@@ -367,7 +368,7 @@ public class LanguageSettingsProvidersSerializer {
*/
public static void setWorkspaceProviders(List<ILanguageSettingsProvider> providers) throws CoreException {
setWorkspaceProvidersInternal(providers);
- serializeLanguageSettingsWorkspace();
+ serializeLanguageSettingsWorkspaceInBackground();
// generate preference change event for preference change listeners (value is not intended to be used)
IEclipsePreferences prefs = InstanceScope.INSTANCE.getNode(CCorePlugin.PLUGIN_ID);
prefs.putBoolean(PREFERENCE_WORSPACE_PROVIDERS_SET, ! prefs.getBoolean(PREFERENCE_WORSPACE_PROVIDERS_SET, false));
@@ -592,6 +593,17 @@ public class LanguageSettingsProvidersSerializer {
* Load language settings for workspace.
*/
public static void loadLanguageSettingsWorkspace() {
+ // ensure completion of any scheduled background serialization
+ try {
+ Job.getJobManager().join(JOB_FAMILY_SERIALIZE_LANGUAGE_SETTINGS_WORKSPACE, null);
+ } catch (OperationCanceledException e) {
+ return;
+ } catch (InterruptedException e) {
+ CCorePlugin.log(e);
+ // restore interrupted status
+ Thread.currentThread().interrupt();
+ }
+
List <ILanguageSettingsProvider> providers = null;
URI uriStoreWsp = getStoreInWorkspaceArea(STORAGE_WORKSPACE_LANGUAGE_SETTINGS);

Back to the top