diff options
author | Christian W. Damus | 2016-09-07 13:28:53 +0000 |
---|---|---|
committer | Christian W. Damus | 2016-09-07 14:13:14 +0000 |
commit | 8b112cb4516e206f0f26d0a80a519e6c0e39bfef (patch) | |
tree | 687ee49ff54b7a248586cdb4bd33f6209f7e94db /plugins/infra/emf/org.eclipse.papyrus.infra.emf | |
parent | 8a381931fb5f9c5c957cb15d380ee74c4498f948 (diff) | |
download | org.eclipse.papyrus-8b112cb4516e206f0f26d0a80a519e6c0e39bfef.tar.gz org.eclipse.papyrus-8b112cb4516e206f0f26d0a80a519e6c0e39bfef.tar.xz org.eclipse.papyrus-8b112cb4516e206f0f26d0a80a519e6c0e39bfef.zip |
Bug 500990: [Indexer] Deadlock on IndexManager blocks label decoration and Papyrus editor
https://bugs.eclipse.org/bugs/show_bug.cgi?id=500990
Move the start-up of the index manager from a static initializer (which
causes deadlocks in threads accessing the IndexManager class in a race)
into the job that creates the index manager in the first place.
(cherry-picked from streams/2.0-maintenance)
Change-Id: I86af3cd2e1376fcda760bfe16872220d64fb1441
Diffstat (limited to 'plugins/infra/emf/org.eclipse.papyrus.infra.emf')
2 files changed, 4 insertions, 8 deletions
diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java index a28b0c13ec4..4a59bf3532c 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/Activator.java @@ -8,7 +8,7 @@ * * Contributors: * Camille Letavernier (camille.letavernier@cea.fr) - Initial API and implementation - * Christian W. Damus - bugs 485220, 496299 + * Christian W. Damus - bugs 485220, 496299, 500990 * *****************************************************************************/ package org.eclipse.papyrus.infra.emf; @@ -95,7 +95,9 @@ public class Activator extends Plugin { @Override protected IStatus run(IProgressMonitor monitor) { - IndexManager.getInstance(); + // This cannot be done in the IndexManager constructor because + // indices that it loads depend on the instance already being set + IndexManager.getInstance().startManager(); return Status.OK_STATUS; } diff --git a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java index 9a389946256..b8798a0c913 100644 --- a/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java +++ b/plugins/infra/emf/org.eclipse.papyrus.infra.emf/src/org/eclipse/papyrus/infra/emf/internal/resource/index/IndexManager.java @@ -95,12 +95,6 @@ public class IndexManager { private JobWrangler jobWrangler; private final CopyOnWriteArrayList<IndexListener> listeners = new CopyOnWriteArrayList<>(); - static { - // This cannot be done in the constructor because indices that I load - // depend on the INSTANCE field already being set - INSTANCE.startManager(); - } - public IndexManager() { super(); |