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/PDOM.java15
1 files changed, 8 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
index 2743a833941..c22cfcec58c 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/PDOM.java
@@ -1085,21 +1085,22 @@ public class PDOM extends PlatformObject implements IPDOM {
return fLinkageIDCache.get(linkage.getLinkageID());
}
- private IBinding inProgress;
+ private ThreadLocal<IBinding> inProgress = new ThreadLocal<IBinding>();
@Override
public IIndexFragmentBinding adaptBinding(IBinding binding) throws CoreException {
- if (inProgress == binding) {
+ if (inProgress.get() == binding) {
// Detect if we're recursing during the adapt. That shouldn't happen and
// leads to stack overflow when it does.
return null;
}
- inProgress = binding;
- IIndexFragmentBinding result = adaptBinding(binding, true);
- inProgress = null;
-
- return result;
+ inProgress.set(binding);
+ try {
+ return adaptBinding(binding, true);
+ } finally {
+ inProgress.set(null);
+ }
}
private IIndexFragmentBinding adaptBinding(IBinding binding, boolean includeLocal) throws CoreException {

Back to the top