Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJeff Johnston2019-05-15 15:55:02 -0400
committerJeff Johnston2019-05-15 16:05:29 -0400
commit19e4eabff27e9a699e51edddc43b5f2e6d76d26e (patch)
tree347c4c5f162885e69c7f83dc43a1768a03ba8041 /core
parent38a084ce6dac1515bb299fbea16f5b68e9829638 (diff)
downloadorg.eclipse.cdt-19e4eabff27e9a699e51edddc43b5f2e6d76d26e.tar.gz
org.eclipse.cdt-19e4eabff27e9a699e51edddc43b5f2e6d76d26e.tar.xz
org.eclipse.cdt-19e4eabff27e9a699e51edddc43b5f2e6d76d26e.zip
Bug 547145 - Core build use of ProjectDescription should be synchronized
- synchronized core build project description manipulations using CoreModel as synchronization class Change-Id: Ic1312d5819ddc08acb492f57a2d87f1998329805
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java9
-rw-r--r--core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java19
2 files changed, 17 insertions, 11 deletions
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
index d2582994fa..723ced6db4 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/core/build/CBuildConfiguration.java
@@ -281,9 +281,12 @@ public abstract class CBuildConfiguration extends PlatformObject implements ICBu
return;
}
- IProjectDescription projectDesc = project.getDescription();
- projectDesc.setActiveBuildConfig(config.getName());
- project.setDescription(projectDesc, monitor);
+ CoreModel m = CoreModel.getDefault();
+ synchronized (m) {
+ IProjectDescription projectDesc = project.getDescription();
+ projectDesc.setActiveBuildConfig(config.getName());
+ project.setDescription(projectDesc, monitor);
+ }
}
protected Preferences getSettings() {
diff --git a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java
index ccdf727914..89d2dc6fb9 100644
--- a/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java
+++ b/core/org.eclipse.cdt.core/src/org/eclipse/cdt/internal/core/build/CBuildConfigurationManager.java
@@ -160,15 +160,18 @@ public class CBuildConfigurationManager
String configName, IProgressMonitor monitor) throws CoreException {
String name = provider.getId() + '/' + configName;
- Set<String> names = new HashSet<>();
- for (IBuildConfiguration config : project.getBuildConfigs()) {
- names.add(config.getName());
- }
+ CoreModel m = CoreModel.getDefault();
+ synchronized (m) {
+ Set<String> names = new HashSet<>();
+ for (IBuildConfiguration config : project.getBuildConfigs()) {
+ names.add(config.getName());
+ }
- IProjectDescription desc = project.getDescription();
- names.add(name);
- desc.setBuildConfigs(names.toArray(new String[names.size()]));
- project.setDescription(desc, monitor);
+ IProjectDescription desc = project.getDescription();
+ names.add(name);
+ desc.setBuildConfigs(names.toArray(new String[names.size()]));
+ project.setDescription(desc, monitor);
+ }
return project.getBuildConfig(name);
}

Back to the top