Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java23
1 files changed, 15 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java
index baae827b320..f0c98a3ecf6 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastIndexerJob.java
@@ -52,32 +52,39 @@ public abstract class PDOMFastIndexerJob implements IPDOMIndexerTask {
return indexer;
}
- protected void addTU(ITranslationUnit tu) throws InterruptedException, CoreException {
+ protected void addTU(ITranslationUnit tu) throws CoreException {
ILanguage language = tu.getLanguage();
if (language == null)
return;
// get the AST in a "Fast" way
- pdom.acquireReadLock();
- IASTTranslationUnit ast = language.getASTTranslationUnit(tu,
- codeReaderFactory,
- ILanguage.AST_USE_INDEX | ILanguage.AST_SKIP_IF_NO_BUILD_INFO);
- pdom.releaseReadLock();
+ IASTTranslationUnit ast;
+ try {
+ pdom.acquireReadLock();
+ ast = language.getASTTranslationUnit(tu,
+ codeReaderFactory,
+ ILanguage.AST_USE_INDEX | ILanguage.AST_SKIP_IF_NO_BUILD_INFO);
+ } catch (InterruptedException e) {
+ return;
+ } finally {
+ pdom.releaseReadLock();
+ }
if (ast == null)
return;
// Clear the macros
codeReaderFactory.clearMacros();
- pdom.acquireWriteLock();
try {
+ pdom.acquireWriteLock();
addSymbols(language, ast);
+ } catch (InterruptedException e) {
} finally {
pdom.releaseWriteLock();
}
}
- protected void addSymbols(ILanguage language, IASTTranslationUnit ast) throws InterruptedException, CoreException {
+ protected void addSymbols(ILanguage language, IASTTranslationUnit ast) throws CoreException {
final PDOMLinkage linkage = pdom.getLinkage(language);
if (linkage == null)
return;

Back to the top