summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChandler Zhang2013-05-20 11:16:45 (EDT)
committer Nick Sandonato2013-05-20 11:46:38 (EDT)
commit91872a9852b961687339fe313870012bc3f0ca1a (patch)
treee6ee032cf463b8c6e576762518a86cb44ccd26ff
parent3d43c8c2f7036e9a21be019758173b66a28ca5b6 (diff)
downloadwebtools.sourceediting-91872a9852b961687339fe313870012bc3f0ca1a.zip
webtools.sourceediting-91872a9852b961687339fe313870012bc3f0ca1a.tar.gz
webtools.sourceediting-91872a9852b961687339fe313870012bc3f0ca1a.tar.bz2
[407513] Deadlock when running 'Taglib validation' jobv201305231718
-rw-r--r--bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
index 77f04a5..47cdb91 100644
--- a/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
+++ b/bundles/org.eclipse.jst.jsp.core/src/org/eclipse/jst/jsp/core/taglib/ProjectDescription.java
@@ -2267,6 +2267,8 @@ class ProjectDescription {
if (deltaKind == ITaglibIndexDelta.ADDED || deltaKind == ITaglibIndexDelta.CHANGED) {
// XXX: runs on folders as well?!
libraryRecord = createJARRecord(libraryLocation);
+ //Store the delta in temp list, then copy them to TaglibIndex to avoid deadlock.
+ List tempDeltas = new ArrayList();
synchronized (libraryRecord) {
if (libraryRecord.isConsistent) {
// Library loaded by another Project Description, initialize our references from the existing
@@ -2279,7 +2281,8 @@ class ProjectDescription {
urlDeltaKind = ITaglibIndexDelta.CHANGED;
}
fClasspathReferences.put(record.getURI(), record);
- TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, record, urlDeltaKind));
+ //Add the delta to TablibIndex out of the synchronized block to avoid deadlock
+ tempDeltas.add(new TaglibIndexDelta(fProject, record, urlDeltaKind));
fClasspathReferences.put(record.info.uri, record);
}
return;
@@ -2316,7 +2319,8 @@ class ProjectDescription {
urlDeltaKind = ITaglibIndexDelta.CHANGED;
}
fClasspathReferences.put(urlRecord.getURI(), urlRecord);
- TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, urlRecord, urlDeltaKind));
+ //Add the delta to TablibIndex out of the synchronized block to avoid deadlock
+ tempDeltas.add(new TaglibIndexDelta(fProject, urlRecord, urlDeltaKind));
fClasspathReferences.put(info.uri, urlRecord);
if (_debugIndexCreation)
Logger.log(Logger.INFO, "created record for " + urlRecord.getURI() + "@" + urlRecord.getURL()); //$NON-NLS-1$ //$NON-NLS-2$
@@ -2348,6 +2352,11 @@ class ProjectDescription {
}
libraryRecord.isConsistent = true;
}
+ //Add delta out of the synchronized block to avoid deadlock
+ Iterator it = tempDeltas.iterator();
+ while(it.hasNext()) {
+ TaglibIndex.getInstance().addDelta((TaglibIndexDelta)it.next());
+ }
}
if (libraryRecord != null) {
TaglibIndex.getInstance().addDelta(new TaglibIndexDelta(fProject, libraryRecord, deltaKind));