aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Loskutov2012-04-10 09:44:14 (EDT)
committerJohn Arthorne2012-04-10 09:44:14 (EDT)
commit52a7f6d48eacc72506ba42a6216246d2b4e441e8 (patch)
treef692dcd50b8f9705c5b525d4b6c83743f955f61e
parent087d3b0910013b190998a81e3d49f2b99f7f1e34 (diff)
downloadrt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.zip
rt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.tar.gz
rt.equinox.bundles-52a7f6d48eacc72506ba42a6216246d2b4e441e8.tar.bz2
by synchronizing on a public object
-rw-r--r--bundles/org.eclipse.equinox.preferences/src/org/eclipse/core/internal/preferences/EclipsePreferences.java7
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 5659cc6..9203459 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)