From 793819c7b4728ced33eb148a9caac2bb454d5b94 Mon Sep 17 00:00:00 2001 From: markt Date: Sat, 31 Jul 2010 14:02:29 +0000 Subject: [PATCH] Revert r966596 - pollTime is in microseconds, wait is in milliseconds 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 | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index bf60c98eb..7635a5482 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -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(); } -- 2.11.0