From: markt Date: Sat, 2 Jul 2011 12:01:30 +0000 (+0000) Subject: Only add instance if it has just been created. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=c199156f8056ca74f4da35963423f89f619d1786;p=tomcat7.0 Only add instance if it has just been created. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1142209 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java index 2d8d15e49..2c154d699 100644 --- a/java/org/apache/catalina/core/StandardWrapper.java +++ b/java/org/apache/catalina/core/StandardWrapper.java @@ -845,11 +845,13 @@ public class StandardWrapper extends ContainerBase } if (singleThreadModel) { - // Have to do this outside of the sync above to prevent a - // possible deadlock - synchronized (instancePool) { - instancePool.push(instance); - nInstances++; + if (newInstance) { + // Have to do this outside of the sync above to prevent a + // possible deadlock + synchronized (instancePool) { + instancePool.push(instance); + nInstances++; + } } } else { if (log.isTraceEnabled())