mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 17:56:01 +02:00
Bug 359485: Workaround deadlock with preferences.
This commit is contained in:
parent
419eca0c3f
commit
242b783c8c
1 changed files with 10 additions and 3 deletions
|
@ -85,6 +85,7 @@ import org.eclipse.core.resources.IFile;
|
||||||
import org.eclipse.core.resources.IProject;
|
import org.eclipse.core.resources.IProject;
|
||||||
import org.eclipse.core.resources.IResource;
|
import org.eclipse.core.resources.IResource;
|
||||||
import org.eclipse.core.resources.IResourceChangeEvent;
|
import org.eclipse.core.resources.IResourceChangeEvent;
|
||||||
|
import org.eclipse.core.resources.ProjectScope;
|
||||||
import org.eclipse.core.resources.ResourcesPlugin;
|
import org.eclipse.core.resources.ResourcesPlugin;
|
||||||
import org.eclipse.core.runtime.CoreException;
|
import org.eclipse.core.runtime.CoreException;
|
||||||
import org.eclipse.core.runtime.IConfigurationElement;
|
import org.eclipse.core.runtime.IConfigurationElement;
|
||||||
|
@ -481,6 +482,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
String newid= IndexerPreferences.get(prj, IndexerPreferences.KEY_INDEXER_ID, IPDOMManager.ID_NO_INDEXER);
|
String newid= IndexerPreferences.get(prj, IndexerPreferences.KEY_INDEXER_ID, IPDOMManager.ID_NO_INDEXER);
|
||||||
Properties props= IndexerPreferences.getProperties(prj);
|
Properties props= IndexerPreferences.getProperties(prj);
|
||||||
|
|
||||||
|
// Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=359485
|
||||||
|
synchronized (new ProjectScope(prj).getNode(CCorePlugin.PLUGIN_ID)) {
|
||||||
synchronized (fUpdatePolicies) {
|
synchronized (fUpdatePolicies) {
|
||||||
if (fClosingProjects.contains(prj.getName())) {
|
if (fClosingProjects.contains(prj.getName())) {
|
||||||
return;
|
return;
|
||||||
|
@ -504,7 +507,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
enqueue(new PDOMRebuildTask(indexer));
|
enqueue(new PDOMRebuildTask(indexer));
|
||||||
}
|
}
|
||||||
}
|
}}
|
||||||
|
|
||||||
if (oldIndexer != null) {
|
if (oldIndexer != null) {
|
||||||
stopIndexer(oldIndexer);
|
stopIndexer(oldIndexer);
|
||||||
|
@ -537,6 +540,8 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
|
|
||||||
assert !Thread.holdsLock(fProjectToPDOM);
|
assert !Thread.holdsLock(fProjectToPDOM);
|
||||||
try {
|
try {
|
||||||
|
// Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=359485
|
||||||
|
synchronized (new ProjectScope(prj).getNode(CCorePlugin.PLUGIN_ID)) {
|
||||||
synchronized (fUpdatePolicies) {
|
synchronized (fUpdatePolicies) {
|
||||||
if (fClosingProjects.contains(name)) {
|
if (fClosingProjects.contains(name)) {
|
||||||
if (fTraceIndexerSetup)
|
if (fTraceIndexerSetup)
|
||||||
|
@ -586,12 +591,14 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}}
|
||||||
|
|
||||||
// rebuild is required, try import first.
|
// rebuild is required, try import first.
|
||||||
TeamPDOMImportOperation operation= new TeamPDOMImportOperation(project);
|
TeamPDOMImportOperation operation= new TeamPDOMImportOperation(project);
|
||||||
operation.run(pm);
|
operation.run(pm);
|
||||||
|
|
||||||
|
// Workaround for https://bugs.eclipse.org/bugs/show_bug.cgi?id=359485
|
||||||
|
synchronized (new ProjectScope(prj).getNode(CCorePlugin.PLUGIN_ID)) {
|
||||||
synchronized (fUpdatePolicies) {
|
synchronized (fUpdatePolicies) {
|
||||||
if (fClosingProjects.contains(name)) {
|
if (fClosingProjects.contains(name)) {
|
||||||
if (fTraceIndexerSetup)
|
if (fTraceIndexerSetup)
|
||||||
|
@ -618,7 +625,7 @@ public class PDOMManager implements IWritableIndexManager, IListener {
|
||||||
task= new PDOMRebuildTask(indexer);
|
task= new PDOMRebuildTask(indexer);
|
||||||
}
|
}
|
||||||
enqueue(task);
|
enqueue(task);
|
||||||
}
|
}}
|
||||||
} catch (CoreException e) {
|
} catch (CoreException e) {
|
||||||
// Ignore if project is no longer open
|
// Ignore if project is no longer open
|
||||||
if (prj.isOpen()) {
|
if (prj.isOpen()) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue