From 361aa3e14eabda213fc3f69767ab4fbea62ccbae Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Tue, 1 Mar 2005 22:00:59 +0000 Subject: [PATCH] Fix a possible deadlock --- .../eclipse/cdt/internal/core/model/PathEntryManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java index 3f59738cd51..6c530f301d5 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java @@ -822,7 +822,11 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange if (!lock.isContainerInitialize()) { runInitializer = true; lock.setContainerInitialize(runInitializer); - } else { + } else if (! Thread.holdsLock(lock)){ + // FIXME: Use Thread.holdsLock(lock) to break the cycle. + // This seem to happend when the container(say the auto discovery) + // trigger a resource change, the CoreModel will try to get the pathentries .. deadlock. + // Wait for the inialization to finish. while (containerGet(project, containerPath, true) instanceof PathEntryContainerLock) { try {