Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Johnston2019-05-15 15:55:02 -0400
committerJeff Johnston2019-05-15 16:05:29 -0400
commit19e4eabff27e9a699e51edddc43b5f2e6d76d26e (patch)
tree347c4c5f162885e69c7f83dc43a1768a03ba8041
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
-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
-rw-r--r--debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF2
-rw-r--r--debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchConfigDelegate.java10
4 files changed, 25 insertions, 15 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);
}
diff --git a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
index 0b02a406d1..aecca6c71a 100644
--- a/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
+++ b/debug/org.eclipse.cdt.debug.core/META-INF/MANIFEST.MF
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %pluginName
Bundle-SymbolicName: org.eclipse.cdt.debug.core; singleton:=true
-Bundle-Version: 8.3.100.qualifier
+Bundle-Version: 8.3.200.qualifier
Bundle-Activator: org.eclipse.cdt.debug.core.CDebugCorePlugin
Bundle-Vendor: %providerName
Bundle-Localization: plugin
diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchConfigDelegate.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchConfigDelegate.java
index 8c29617c24..200faa6db4 100644
--- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchConfigDelegate.java
+++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/core/launch/CoreBuildLaunchConfigDelegate.java
@@ -18,6 +18,7 @@ import org.eclipse.cdt.core.build.ICBuildConfiguration;
import org.eclipse.cdt.core.build.ICBuildConfigurationManager;
import org.eclipse.cdt.core.build.IToolChain;
import org.eclipse.cdt.core.build.IToolChainManager;
+import org.eclipse.cdt.core.model.CoreModel;
import org.eclipse.cdt.core.model.IBinary;
import org.eclipse.cdt.debug.core.CDebugCorePlugin;
import org.eclipse.cdt.debug.internal.core.InternalDebugCoreMessages;
@@ -139,9 +140,12 @@ public abstract class CoreBuildLaunchConfigDelegate extends LaunchConfigurationT
ICBuildConfiguration buildConfig = getBuildConfiguration(configuration, mode, target, monitor);
if (buildConfig != null) {
IProject project = getProject(configuration);
- IProjectDescription desc = project.getDescription();
- desc.setActiveBuildConfig(buildConfig.getBuildConfiguration().getName());
- project.setDescription(desc, monitor);
+ CoreModel m = CoreModel.getDefault();
+ synchronized (m) {
+ IProjectDescription desc = project.getDescription();
+ desc.setActiveBuildConfig(buildConfig.getBuildConfiguration().getName());
+ project.setDescription(desc, monitor);
+ }
}
// proceed with the build

Back to the top