james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hil...@apache.org
Subject svn commit: r328316 - /james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java
Date Tue, 25 Oct 2005 08:50:33 GMT
Author: hilmer
Date: Tue Oct 25 01:50:29 2005
New Revision: 328316

URL: http://svn.apache.org/viewcvs?rev=328316&view=rev
Log:
JAMES-428

Modified:
    james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java

Modified: james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java
URL: http://svn.apache.org/viewcvs/james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java?rev=328316&r1=328315&r2=328316&view=diff
==============================================================================
--- james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java (original)
+++ james/server/trunk/src/java/org/apache/james/util/connection/ServerConnection.java Tue
Oct 25 01:50:29 2005
@@ -220,6 +220,18 @@
      * @param clientConnectionRunner the ClientConnectionRunner to be removed
      */
     private void removeClientConnectionRunner(ClientConnectionRunner clientConnectionRunner)
{
+
+       /*
+        * checking runnerPool avoids 'dead-lock' when service is disposing :
+        * (dispose() calls dispose all runners)
+        * but runner is 'running' and cleans up on exit
+        * this situation will result in a dead-lock on 'clientConnectionRunners'
+        */
+        if( runnerPool == null ) {
+            getLogger().info("ServerConnection.removeClientConnectionRunner - dispose has
been called - so just return : " + clientConnectionRunner );
+            return;
+        }
+        
         synchronized (clientConnectionRunners) {
             if (clientConnectionRunners.remove(clientConnectionRunner)) {
                 if (getLogger().isDebugEnabled()) {



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message