Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2007-12-07 08:47:53 -0500
committerMarkus Schorn2007-12-07 08:47:53 -0500
commite38eb96dd0138d1daee41129df156802f465d5cb (patch)
treebcdfa986953e8b1339e1871b378cc60d67368ae4
parentd295a9834f48d5882b21142236933ecb784d3f26 (diff)
downloadorg.eclipse.cdt-e38eb96dd0138d1daee41129df156802f465d5cb.tar.gz
org.eclipse.cdt-e38eb96dd0138d1daee41129df156802f465d5cb.tar.xz
org.eclipse.cdt-e38eb96dd0138d1daee41129df156802f465d5cb.zip
Indexer can indirectly block jobs with workspace-rule (bug 211603).
-rw-r--r--core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java3
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java10
2 files changed, 9 insertions, 4 deletions
diff --git a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
index 8797499917..6cc0cf343c 100644
--- a/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
+++ b/core/org.eclipse.cdt.core.tests/parser/org/eclipse/cdt/internal/pdom/tests/GeneratePDOMApplicationTest.java
@@ -214,7 +214,8 @@ public class GeneratePDOMApplicationTest extends PDOMTestBase {
} finally {
wpdom.releaseReadLock();
}
- assertTrue(stateCount[0] == 2);
+ // depending on the timing the index of the temporary project is changed twice.
+ assertTrue(stateCount[0] == 2 || stateCount[0] == 4);
}
public void testExternalExportProjectProvider_SysIncludes() throws Exception {
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
index 1f7c1fe3e8..6ce38c6fa0 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOMManager.java
@@ -138,6 +138,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
private static final ISchedulingRule NOTIFICATION_SCHEDULING_RULE = new PerInstanceSchedulingRule();
private static final ISchedulingRule INDEXER_SCHEDULING_RULE = new PerInstanceSchedulingRule();
+ private static final ISchedulingRule INIT_INDEXER_SCHEDULING_RULE = new PerInstanceSchedulingRule();
/**
* Protects indexerJob, currentTask and taskQueue.
@@ -654,10 +655,13 @@ public class PDOMManager implements IWritableIndexManager, IListener {
// have to check for that.
ISchedulingRule rule= project.getWorkspace().getRuleFactory().refreshRule(project.getFolder(SETTINGS_FOLDER_NAME));
if (project.contains(rule)) {
- rule= new MultiRule(new ISchedulingRule[] {project, INDEXER_SCHEDULING_RULE });
+ rule= MultiRule.combine(project, INIT_INDEXER_SCHEDULING_RULE);
}
- else if (!rule.contains(project)) {
- rule= new MultiRule(new ISchedulingRule[] {rule, project, INDEXER_SCHEDULING_RULE });
+ else if (rule.contains(project)) {
+ rule= MultiRule.combine(rule, INIT_INDEXER_SCHEDULING_RULE);
+ }
+ else {
+ rule= MultiRule.combine(new ISchedulingRule[] {rule, project, INIT_INDEXER_SCHEDULING_RULE });
}
addProject.setRule(rule);
addProject.setSystem(true);

Back to the top