Author: markt Date: Sun Feb 14 19:53:02 2016 New Revision: 1730392 URL: http://svn.apache.org/viewvc?rev=1730392&view=rev Log: Simplify the NIO poller loop
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1730392&r1=1730391&r2=1730392&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Sun Feb 14 19:53:02 2016 @@ -824,22 +824,9 @@ public class NioEndpoint extends Abstrac boolean hasEvents = false; - // Time to terminate? - if (close) { - events(); - timeout(0, false); - try { - selector.close(); - } catch (IOException ioe) { - log.error(sm.getString( - "endpoint.nio.selectorCloseFail"), ioe); - } - break; - } else { - hasEvents = events(); - } try { - if ( !close ) { + if (!close) { + hasEvents = events(); if (wakeupCounter.getAndSet(-1) > 0) { //if we are here, means we have other stuff to do //do a non blocking select @@ -855,8 +842,7 @@ public class NioEndpoint extends Abstrac try { selector.close(); } catch (IOException ioe) { - log.error(sm.getString( - "endpoint.nio.selectorCloseFail"), ioe); + log.error(sm.getString("endpoint.nio.selectorCloseFail"), ioe); } break; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org