From: markt Date: Tue, 27 Jul 2010 20:27:16 +0000 (+0000) Subject: Only need to wait a single pollTime, not one pollTime for each poller. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=022c57871c63f5b024ae3747c430f88d5c4e989e;p=tomcat7.0 Only need to wait a single pollTime, not one pollTime for each poller. git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@979852 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 822347a4d..c96edc17d 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -663,6 +663,16 @@ public class AprEndpoint extends AbstractEndpoint { if (running) { running = false; unlockAccept(); + // Wait for polltime before doing anything, so that the poller threads + // exit, otherwise parallel destruction of sockets which are still + // in the poller can cause problems + try { + synchronized (this) { + this.wait(pollTime); + } + } catch (InterruptedException e) { + // Ignore + } for (int i = 0; i < pollers.length; i++) { pollers[i].destroy(); } @@ -959,16 +969,6 @@ public class AprEndpoint extends AbstractEndpoint { * Destroy the poller. */ protected void destroy() { - // Wait for polltime before doing anything, so that the poller threads - // exit, otherwise parallel destruction of sockets which are still - // in the poller can cause problems - try { - synchronized (this) { - this.wait(pollTime); - } - } catch (InterruptedException e) { - // Ignore - } // Close all sockets in the add queue for (int i = 0; i < addCount; i++) { if (comet) { @@ -1218,16 +1218,6 @@ public class AprEndpoint extends AbstractEndpoint { * Destroy the poller. */ protected void destroy() { - // Wait for polltime before doing anything, so that the poller threads - // exit, otherwise parallel destruction of sockets which are still - // in the poller can cause problems - try { - synchronized (this) { - this.wait(pollTime); - } - } catch (InterruptedException e) { - // Ignore - } // Close any socket remaining in the add queue addCount = 0; for (int i = (addS.size() - 1); i >= 0; i--) {