diff options
| author | Andrey Loskutov | 2012-04-10 13:44:14 +0000 |
|---|---|---|
| committer | John Arthorne | 2012-04-10 13:44:14 +0000 |
| commit | 52a7f6d48eacc72506ba42a6216246d2b4e441e8 (patch) | |
| tree | f692dcd50b8f9705c5b525d4b6c83743f955f61e | |
| parent | 087d3b0910013b190998a81e3d49f2b99f7f1e34 (diff) | |
| download | rt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.tar.gz rt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.tar.xz rt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.zip | |
Bug 376206 - [prefs] EclipsePreferences creates deadlock riskv20120410-1344N20120417-1633N20120417-1307I20120426-0800I20120425-1600I20120425-1200I20120425-0800I20120424-1700I20120424-1600I20120424-0800I20120419-1434I20120418-0248I20120417-1000
by synchronizing on a public object
| -rw-r--r-- | bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java index 5659cc607..920345974 100644 --- a/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java +++ b/bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java @@ -1137,7 +1137,12 @@ public class EclipsePreferences implements IEclipsePreferences, IScope { * @param pool The pool to share strings in */ public void shareStrings(StringPool pool) { - properties.shareStrings(pool); + //thread safety: copy reference in case of concurrent change + ImmutableMap temp; + synchronized (childAndPropertyLock) { + temp = properties; + } + temp.shareStrings(pool); IEclipsePreferences[] myChildren = getChildren(false); for (int i = 0; i < myChildren.length; i++) if (myChildren[i] instanceof EclipsePreferences) |
