Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Recoskie2010-05-11 22:50:20 +0000
committerChris Recoskie2010-05-11 22:50:20 +0000
commit947eedd5bc0599f5cc39c7646cca25e656169621 (patch)
tree81a4d4d2c0adc5afea2f132034f8fea0cd8f1b7c /build/org.eclipse.cdt.managedbuilder.core
parenta9b247a3f2fbd1eb87dd2c2ab518ebad5b305db0 (diff)
downloadorg.eclipse.cdt-947eedd5bc0599f5cc39c7646cca25e656169621.tar.gz
org.eclipse.cdt-947eedd5bc0599f5cc39c7646cca25e656169621.tar.xz
org.eclipse.cdt-947eedd5bc0599f5cc39c7646cca25e656169621.zip
- Merged changes from cdt_5_0 to HEAD. Too many to mention individually.
- Reworked IFileSystem utility so that now it is noimplement/noextend. Clients should now extend from concrete class FileSystemUtility instead to better insulate them from future API changes. - Reworked the resulting concurrency fixes - indexing and scanner discovery now synchronize on the project root as a scheduling rule. Original HEAD behaviour was to synch on the project's .settings folder for indexing, but that deadlocked with scanner discovery. - Fixed remote indexing. Changes on HEAD that deprecated CodeReader broke the ability for remote translation units to provide the path to load the file content from. Added API to ITranslationUnit for this purpose.
Diffstat (limited to 'build/org.eclipse.cdt.managedbuilder.core')
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java4
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java58
-rw-r--r--build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties2
3 files changed, 48 insertions, 16 deletions
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
index 0750897a3bf..356bc1ab269 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/core/scannerconfig/ScannerConfigBuilder.java
@@ -199,7 +199,9 @@ public class ScannerConfigBuilder extends ACBuilder {
// update and persist scanner configuration
CfgSCJobsUtil.updateScannerConfiguration(project, context, instance, buildInfo2, new SubProgressMonitor(monitor, 30));
- CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, context, false);
+ // this erroneously removes the infor right after it gets created... bad
+ //CfgDiscoveredPathManager.getInstance().removeDiscoveredInfo(project, context, false);
+
if((flags & PERFORM_CORE_UPDATE) != 0)
CfgDiscoveredPathManager.getInstance().updateCoreSettings(project, new IConfiguration[]{cfg});
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
index 15295bbf6f1..cd32ab4447f 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/build/internal/core/scannerconfig/CfgDiscoveredPathManager.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Intel Corporation and others.
+ * Copyright (c) 2007, 2010 Intel Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -7,6 +7,7 @@
*
* Contributors:
* Intel Corporation - Initial API and implementation
+ * IBM Corporation
*******************************************************************************/
package org.eclipse.cdt.build.internal.core.scannerconfig;
@@ -59,6 +60,7 @@ import org.eclipse.core.runtime.CoreException;
import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.core.runtime.jobs.ISchedulingRule;
public class CfgDiscoveredPathManager implements IResourceChangeListener {
@@ -67,6 +69,39 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
private IDiscoveredPathManager fBaseMngr;
+
+ private class GetDiscoveredInfoRunnable implements IWorkspaceRunnable {
+
+ private PathInfo fPathInfo;
+ private ContextInfo fContextInfo;
+ private IProject fProject;
+ private CfgInfoContext fContext;
+
+ public GetDiscoveredInfoRunnable(ContextInfo cInfo, IProject project, CfgInfoContext context) {
+ fContextInfo = cInfo;
+ fProject = project;
+ fContext = context;
+ }
+
+ public void run(IProgressMonitor monitor) throws CoreException {
+
+ fPathInfo = getCachedPathInfo(fContextInfo);
+
+ if(fPathInfo == null){
+ IDiscoveredPathManager.IDiscoveredPathInfo baseInfo = loadPathInfo(fProject, fContext.getConfiguration(), fContextInfo);
+
+ fPathInfo = resolveCacheBaseDiscoveredInfo(fContextInfo, baseInfo);
+ }
+
+ }
+
+ public PathInfo getPathInfo() {
+ return fPathInfo;
+ }
+
+ };
+
+
private static class ContextInfo {
public ContextInfo() {
@@ -161,21 +196,16 @@ public class CfgDiscoveredPathManager implements IResourceChangeListener {
PathInfo info = getCachedPathInfo(cInfo);
if (info == null) {
- synchronized (this) {
- info = getCachedPathInfo(cInfo);
+ // Change synchronization to be a lock on the project, otherwise
+ // if the project description is queried from a project change listener, it will deadlock
+
+ GetDiscoveredInfoRunnable runnable = new GetDiscoveredInfoRunnable(cInfo, project, context);
+ ISchedulingRule rule = project;
- if(info == null){
- IDiscoveredPathManager.IDiscoveredPathInfo baseInfo = loadPathInfo(project, context.getConfiguration(), cInfo);
-
- info = resolveCacheBaseDiscoveredInfo(cInfo, baseInfo);
- }
- }
+ ResourcesPlugin.getWorkspace().run(runnable, rule, IWorkspace.AVOID_UPDATE, null);
+
+ info = runnable.getPathInfo();
-// setCachedPathInfo(context, info);
-// if(info instanceof DiscoveredPathInfo && !((DiscoveredPathInfo)info).isLoadded()){
-// info = createPathInfo(project, context);
-// setCachedPathInfo(context, info);
-// }
}
return info;
}
diff --git a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
index f08762cb4d3..cb4ff40b0b2 100644
--- a/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
+++ b/build/org.eclipse.cdt.managedbuilder.core/src/org/eclipse/cdt/managedbuilder/internal/core/PluginResources.properties
@@ -1,5 +1,5 @@
###############################################################################
-# Copyright (c) 2002, 2007 Rational Software Corporation and others.
+# Copyright (c) 2002, 2010 Rational Software Corporation and others.
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Eclipse Public License v1.0
# which accompanies this distribution, and is available at

Back to the top