Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Schorn2008-02-26 12:48:36 +0000
committerMarkus Schorn2008-02-26 12:48:36 +0000
commit33d68a6603e353f9478bbc4253593c34019e4d51 (patch)
tree0da495e78e27c60d4a870fcfe3703dc901137eb3 /core/org.eclipse.cdt.core/parser
parent8bc306225d38f902620127d102ac74b93b6b846f (diff)
downloadorg.eclipse.cdt-33d68a6603e353f9478bbc4253593c34019e4d51.tar.gz
org.eclipse.cdt-33d68a6603e353f9478bbc4253593c34019e4d51.tar.xz
org.eclipse.cdt-33d68a6603e353f9478bbc4253593c34019e4d51.zip
PDOMExport needs to wait until indexer is setup, related to 199551.
Diffstat (limited to 'core/org.eclipse.cdt.core/parser')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java
index ad6f6ebb6f1..1fc92e6b642 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/export/GeneratePDOM.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007 Symbian Software Systems and others.
+ * Copyright (c) 2007, 2008 Symbian Software Systems 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
@@ -18,6 +18,7 @@ import java.util.Map;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.index.IIndexLocationConverter;
+import org.eclipse.cdt.core.index.IIndexManager;
import org.eclipse.cdt.core.index.export.IExportProjectProvider;
import org.eclipse.cdt.core.model.ICProject;
import org.eclipse.cdt.core.model.LanguageManager;
@@ -66,9 +67,17 @@ public class GeneratePDOM implements ISafeRunnable {
// index the project
IndexerPreferences.set(cproject.getProject(), IndexerPreferences.KEY_INDEXER_ID, indexerID);
- CCorePlugin.getIndexManager().joinIndexer(Integer.MAX_VALUE, new NullProgressMonitor());
try {
+ final IIndexManager im = CCorePlugin.getIndexManager();
+ for (int i = 0; i < 20; i++) {
+ im.joinIndexer(Integer.MAX_VALUE, new NullProgressMonitor());
+ if (!im.isIndexerSetupPostponed(cproject)) {
+ break;
+ }
+ Thread.sleep(200);
+ }
+
CCoreInternals.getPDOMManager().exportProjectPDOM(cproject, targetLocation, converter);
WritablePDOM exportedPDOM= new WritablePDOM(targetLocation, converter, LanguageManager.getInstance().getPDOMLinkageFactoryMappings());
exportedPDOM.acquireWriteLock(0);

Back to the top