mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-31 21:05:37 +02:00
Fix for 179644, scheduling rule for initializing indexer.
This commit is contained in:
parent
e5ff47ccf2
commit
88ea27d319
1 changed files with 19 additions and 3 deletions
|
@ -80,6 +80,7 @@ import org.eclipse.core.runtime.Preferences.IPropertyChangeListener;
|
|||
import org.eclipse.core.runtime.Preferences.PropertyChangeEvent;
|
||||
import org.eclipse.core.runtime.jobs.ISchedulingRule;
|
||||
import org.eclipse.core.runtime.jobs.Job;
|
||||
import org.eclipse.core.runtime.jobs.MultiRule;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener;
|
||||
import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent;
|
||||
|
||||
|
@ -92,6 +93,8 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChange
|
|||
*/
|
||||
public class PDOMManager implements IWritableIndexManager, IListener {
|
||||
|
||||
private static final String SETTINGS_FOLDER_NAME = ".settings"; //$NON-NLS-1$
|
||||
|
||||
private static final class PerInstanceSchedulingRule implements ISchedulingRule {
|
||||
public boolean contains(ISchedulingRule rule) {
|
||||
return rule == this;
|
||||
|
@ -534,7 +537,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
|
||||
private void syncronizeProjectSettings(IProject project, IProgressMonitor monitor) {
|
||||
try {
|
||||
IFolder settings= project.getFolder(".settings"); //$NON-NLS-1$
|
||||
IFolder settings= project.getFolder(SETTINGS_FOLDER_NAME);
|
||||
settings.refreshLocal(IResource.DEPTH_INFINITE, monitor);
|
||||
} catch (CoreException e) {
|
||||
CCorePlugin.log(e);
|
||||
|
@ -546,7 +549,17 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
return family == PDOMManager.this;
|
||||
}
|
||||
};
|
||||
addProject.setRule(project);
|
||||
// in case a team provider does not implement a rule-factory, the
|
||||
// platform makes a pessimistic choice and locks the workspace. We
|
||||
// have to check for that.
|
||||
ISchedulingRule rule= project.getWorkspace().getRuleFactory().refreshRule(project.getFolder(SETTINGS_FOLDER_NAME));
|
||||
if (project.contains(rule)) {
|
||||
rule= project;
|
||||
}
|
||||
else if (!rule.contains(project)) {
|
||||
rule= new MultiRule(new ISchedulingRule[] {rule, project});
|
||||
}
|
||||
addProject.setRule(rule);
|
||||
addProject.setSystem(true);
|
||||
addProject.schedule();
|
||||
}
|
||||
|
@ -598,6 +611,9 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
|||
synchronized (fProjectToPDOM) {
|
||||
IProject rproject= project.getProject();
|
||||
pdom = (WritablePDOM) fProjectToPDOM.remove(rproject);
|
||||
if (pdom != null) {
|
||||
fFileToProject.remove(pdom.getDB().getLocation());
|
||||
}
|
||||
}
|
||||
|
||||
if (pdom != null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue