From f418475601cf1fbf07e50f70c6248c7b4be1b9dd Mon Sep 17 00:00:00 2001 From: fhanik Date: Fri, 11 Aug 2006 16:25:18 +0000 Subject: [PATCH] Fixed the poller destroy method git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@430819 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/net/NioEndpoint.java | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 4d6487b9c..926e6eaba 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -960,14 +960,7 @@ public class NioEndpoint { // exit, otherwise parallel descturction of sockets which are still // in the poller can cause problems close = true; - try { - synchronized (this) { - this.wait(selectorTimeout * 2); - } - } catch (InterruptedException e) { - // Ignore - } - close = true; + selector.wakeup(); } public void addEvent(Runnable event) { @@ -1115,7 +1108,7 @@ public class NioEndpoint { if ( sk.isValid() && attachment != null ) { attachment.access(); sk.attach(attachment); - sk.interestOps(0); + sk.interestOps(0); //this is a must, so that we don't have multiple threads messing with the socket attachment.interestOps(0); NioChannel channel = attachment.getChannel(); if (sk.isReadable() || sk.isWritable() ) { -- 2.11.0