From e58ae1f077d03d0cb89e3995e2357ff754f847f7 Mon Sep 17 00:00:00 2001 From: markt Date: Sun, 5 Sep 2010 19:47:36 +0000 Subject: [PATCH] Make sure acceptor threads are stopped when the connector is stopped. Also fix @Override warnings for the method git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@992881 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/net/AprEndpoint.java | 1 + java/org/apache/tomcat/util/net/JIoEndpoint.java | 3 ++- java/org/apache/tomcat/util/net/NioEndpoint.java | 3 ++- webapps/docs/changelog.xml | 4 ++++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java b/java/org/apache/tomcat/util/net/AprEndpoint.java index 7dcd07bd9..0ffa4daef 100644 --- a/java/org/apache/tomcat/util/net/AprEndpoint.java +++ b/java/org/apache/tomcat/util/net/AprEndpoint.java @@ -918,6 +918,7 @@ public class AprEndpoint extends AbstractEndpoint { * The background thread that listens for incoming TCP/IP connections and * hands them off to an appropriate processor. */ + @Override public void run() { // Loop until we receive a shutdown command diff --git a/java/org/apache/tomcat/util/net/JIoEndpoint.java b/java/org/apache/tomcat/util/net/JIoEndpoint.java index f40694728..813b93399 100644 --- a/java/org/apache/tomcat/util/net/JIoEndpoint.java +++ b/java/org/apache/tomcat/util/net/JIoEndpoint.java @@ -173,13 +173,14 @@ public class JIoEndpoint extends AbstractEndpoint { * The background thread that listens for incoming TCP/IP connections and * hands them off to an appropriate processor. */ + @Override public void run() { // Loop until we receive a shutdown command while (running) { // Loop if endpoint is paused - while (paused) { + while (paused && running) { try { Thread.sleep(1000); } catch (InterruptedException e) { diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index bb4b47c66..adeb61d6f 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -802,11 +802,12 @@ public class NioEndpoint extends AbstractEndpoint { * The background thread that listens for incoming TCP/IP connections and * hands them off to an appropriate processor. */ + @Override public void run() { // Loop until we receive a shutdown command while (running) { // Loop if endpoint is paused - while (paused) { + while (paused && running) { try { Thread.sleep(1000); } catch (InterruptedException e) { diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 3b28785ae..b1c959691 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -135,6 +135,10 @@ Further work to reduce the code duplication in the HTTP connectors. (markt) + + Make sure acceptor threads are stopped when the connector is stopped. + (markt) + -- 2.11.0