From cbc0a114f421d2498463a3176c96f58508fdbe34 Mon Sep 17 00:00:00 2001 From: Greg Wilkins Date: Mon, 15 Jul 2013 16:40:27 +1000 Subject: [PATCH] 412940 minor threadsafe fixes --- .../jetty/server/AbstractConnector.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java index 454f27f39e9..0747b01c52b 100644 --- a/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java +++ b/jetty-server/src/main/java/org/eclipse/jetty/server/AbstractConnector.java @@ -268,10 +268,13 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co protected void interruptAcceptors() { - for (Thread thread : _acceptors) + synchronized (this) { - if (thread != null) - thread.interrupt(); + for (Thread thread : _acceptors) + { + if (thread != null) + thread.interrupt(); + } } } @@ -306,9 +309,12 @@ public abstract class AbstractConnector extends ContainerLifeCycle implements Co public void join(long timeout) throws InterruptedException { - for (Thread thread : _acceptors) - if (thread != null) - thread.join(timeout); + synchronized (this) + { + for (Thread thread : _acceptors) + if (thread != null) + thread.join(timeout); + } } protected abstract void accept(int acceptorID) throws IOException, InterruptedException;