Fixed the poller destroy method
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Aug 2006 16:25:18 +0000 (16:25 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 11 Aug 2006 16:25:18 +0000 (16:25 +0000)
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

index 4d6487b..926e6ea 100644 (file)
@@ -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() ) {