Author: markt Date: Tue Jul 27 20:27:16 2010 New Revision: 979852 URL: http://svn.apache.org/viewvc?rev=979852&view=rev Log: Only need to wait a single pollTime, not one pollTime for each poller.
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=979852&r1=979851&r2=979852&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/AprEndpoint.java Tue Jul 27 20:27:16 2010 @@ -663,6 +663,16 @@ public class AprEndpoint extends Abstrac 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 Abstrac * 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 Abstrac * 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--) { --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org