mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-21 21:52:10 +02:00
Bug 547145 - Core build use of ProjectDescription should be synchronized
- synchronized core build project description manipulations using CoreModel as synchronization class Change-Id: Ic1312d5819ddc08acb492f57a2d87f1998329805
This commit is contained in:
parent
38a084ce6d
commit
19e4eabff2
4 changed files with 25 additions and 15 deletions
|
@ -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() {
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue