tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mt...@apache.org
Subject svn commit: r992252 - /tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
Date Fri, 03 Sep 2010 10:16:00 GMT
Author: mturk
Date: Fri Sep  3 10:16:00 2010
New Revision: 992252

URL: http://svn.apache.org/viewvc?rev=992252&view=rev
Log:
Call join only for alive threads

Modified:
    tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java

Modified: tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java?rev=992252&r1=992251&r2=992252&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Fri Sep  3 10:16:00 2010
@@ -692,32 +692,38 @@ public class AprEndpoint extends Abstrac
             }
             for (int i = 0; i < pollers.length; i++) {
                 pollers[i].destroy();
-                try {
-                    pollers[i].interrupt();
-                    pollers[i].join();
-                } catch (InterruptedException e) {
+                if (pollers[i].isAlive()) {
+                    try {
+                       pollers[i].interrupt();
+                        pollers[i].join();
+                    } catch (InterruptedException e) {
                         // Ignore
+                    }
                 }
             }
             pollers = null;
             for (int i = 0; i < cometPollers.length; i++) {
                 cometPollers[i].destroy();
-                try {
-                    cometPollers[i].interrupt();
-                    cometPollers[i].join();
-                } catch (InterruptedException e) {
+                if (cometPollers[i].isAlive()) {
+                    try {
+                        cometPollers[i].interrupt();
+                        cometPollers[i].join();
+                    } catch (InterruptedException e) {
                         // Ignore
+                    }
                 }
             }
             cometPollers = null;
             if (useSendfile) {
                 for (int i = 0; i < sendfiles.length; i++) {
                     sendfiles[i].destroy();
-                    try {
-                        sendfiles[i].interrupt();
-                        sendfiles[i].join();
-                    } catch (InterruptedException e) {
-                        // Ignore
+                    if (sendfiles[i].isAlive()) {
+                        try {
+                            sendfiles[i].interrupt();
+                            sendfiles[i].join();
+                        } catch (InterruptedException e) {
+                            // Ignore
+                        }
                     }
                 }
                 sendfiles = null;



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


Mime
View raw message