mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Indexer can indirectly block jobs with workspace-rule (bug 211603).
This commit is contained in:
parent
a805540f7f
commit
020598a37c
2 changed files with 9 additions and 4 deletions
|
@ -213,7 +213,8 @@ public class GeneratePDOMApplicationTest extends PDOMTestBase {
|
||||||
} finally {
|
} finally {
|
||||||
wpdom.releaseReadLock();
|
wpdom.releaseReadLock();
|
||||||
}
|
}
|
||||||
assertTrue(stateCount[0] == 2);
|
// depending on the timing the index of the temporary project is changed once or twice.
|
||||||
|
assertTrue(stateCount[0] == 2 || stateCount[0] == 4);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testExternalExportProjectProvider_SysIncludes() throws Exception {
|
public void testExternalExportProjectProvider_SysIncludes() throws Exception {
|
||||||
|
|
|
@ -139,6 +139,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
|
|
||||||
private static final ISchedulingRule NOTIFICATION_SCHEDULING_RULE = new PerInstanceSchedulingRule();
|
private static final ISchedulingRule NOTIFICATION_SCHEDULING_RULE = new PerInstanceSchedulingRule();
|
||||||
private static final ISchedulingRule INDEXER_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.
|
* Protects indexerJob, currentTask and taskQueue.
|
||||||
|
@ -683,10 +684,13 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
// have to check for that.
|
// have to check for that.
|
||||||
ISchedulingRule rule= project.getWorkspace().getRuleFactory().refreshRule(project.getFolder(SETTINGS_FOLDER_NAME));
|
ISchedulingRule rule= project.getWorkspace().getRuleFactory().refreshRule(project.getFolder(SETTINGS_FOLDER_NAME));
|
||||||
if (project.contains(rule)) {
|
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)) {
|
else if (rule.contains(project)) {
|
||||||
rule= new MultiRule(new ISchedulingRule[] {rule, project, INDEXER_SCHEDULING_RULE });
|
rule= MultiRule.combine(rule, INIT_INDEXER_SCHEDULING_RULE);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
rule= MultiRule.combine(new ISchedulingRule[] {rule, project, INIT_INDEXER_SCHEDULING_RULE });
|
||||||
}
|
}
|
||||||
addProject.setRule(rule);
|
addProject.setRule(rule);
|
||||||
addProject.setSystem(true);
|
addProject.setSystem(true);
|
||||||
|
|
Loading…
Add table
Reference in a new issue