Revert r966596 - pollTime is in microseconds, wait is in milliseconds
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 31 Jul 2010 14:02:29 +0000 (14:02 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Sat, 31 Jul 2010 14:02:29 +0000 (14:02 +0000)
Add an additional wait that prevents a JVM crash on shutdown detected in TestAsyncContextImpl tests

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@981061 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/AprEndpoint.java

index bf60c98..7635a54 100644 (file)
@@ -670,7 +670,7 @@ public class AprEndpoint extends AbstractEndpoint {
             // in the poller can cause problems
             try {
                 synchronized (this) {
-                    this.wait(pollTime);
+                    this.wait(pollTime / 1000);
                 }
             } catch (InterruptedException e) {
                 // Ignore
@@ -689,6 +689,15 @@ public class AprEndpoint extends AbstractEndpoint {
                 }
                 sendfiles = null;
             }
+            // Wait another polltime to make sure everything is shutdown else
+            // the JVM will crash when we terminate the APR library
+            try {
+                synchronized (this) {
+                    this.wait(pollTime / 1000);
+                }
+            } catch (InterruptedException e) {
+                // Ignore
+            }
         }
         shutdownExecutor();
     }