Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDoug Schaefer2007-01-29 21:23:04 +0000
committerDoug Schaefer2007-01-29 21:23:04 +0000
commitb878d9a0f3d091990a8a8c5e8944c2515a198451 (patch)
tree386151c2ef332e9d3dca8430056f6ef1414af286
parent32fcfc32d03153520ac3ef29c3b66b1cb86d7405 (diff)
downloadorg.eclipse.cdt-b878d9a0f3d091990a8a8c5e8944c2515a198451.tar.gz
org.eclipse.cdt-b878d9a0f3d091990a8a8c5e8944c2515a198451.tar.xz
org.eclipse.cdt-b878d9a0f3d091990a8a8c5e8944c2515a198451.zip
Fix missing read lock in Fast delta indexer.
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastHandleDelta.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastHandleDelta.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastHandleDelta.java
index d76762cb2a..68b77ec6f2 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastHandleDelta.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/indexer/fast/PDOMFastHandleDelta.java
@@ -129,9 +129,16 @@ class PDOMFastHandleDelta extends PDOMFastIndexerJob {
PDOMCodeReaderFactory codeReaderFactory = new PDOMCodeReaderFactory(pdom);
// get the AST in a "Fast" way
- IASTTranslationUnit ast = language.getASTTranslationUnit(tu,
- codeReaderFactory,
- ILanguage.AST_USE_INDEX | ILanguage.AST_SKIP_IF_NO_BUILD_INFO);
+ IASTTranslationUnit ast = null;
+ pdom.acquireReadLock();
+ try {
+ ast = language.getASTTranslationUnit(tu,
+ codeReaderFactory,
+ ILanguage.AST_USE_INDEX | ILanguage.AST_SKIP_IF_NO_BUILD_INFO);
+ } finally {
+ pdom.releaseReadLock();
+ }
+
if (ast == null)
return;

Back to the top