Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2007-01-18 02:37:06 +0000
committerDoug Schaefer2007-01-18 02:37:06 +0000
commit7439c3eb387b7181bdb9f53cd63f7a7d5b3008e9 (patch)
treeb1f56c401253f4a2d2dc9d9adde7e567c780ee57
parent9bbf3e941af6edf5df7cb384e9118c84921cdff2 (diff)
downloadorg.eclipse.cdt-7439c3eb387b7181bdb9f53cd63f7a7d5b3008e9.tar.gz
org.eclipse.cdt-7439c3eb387b7181bdb9f53cd63f7a7d5b3008e9.tar.xz
org.eclipse.cdt-7439c3eb387b7181bdb9f53cd63f7a7d5b3008e9.zip
Fixed up the Fast indexer which did not release the locks when exceptions occurred causing deadlock in the junits. Why the exceptions are occuring during the automated test suite run is another question...
-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 baae827b32..f0c98a3ecf 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