You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by fh...@apache.org on 2011/09/14 16:39:06 UTC
svn commit: r1170647 -
/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java
Author: fhanik
Date: Wed Sep 14 14:39:05 2011
New Revision: 1170647
URL: http://svn.apache.org/viewvc?rev=1170647&view=rev
Log:
https://issues.apache.org/bugzilla/show_bug.cgi?id=51794
Fix race condition in selector potentially causing a delay in select operations
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=1170647&r1=1170646&r2=1170647&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original)
+++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Wed Sep 14 14:39:05 2011
@@ -1081,13 +1081,11 @@ public class NioEndpoint extends Abstrac
}
try {
if ( !close ) {
- if (wakeupCounter.get()>0) {
+ if (wakeupCounter.getAndSet(-1) > 0) {
//if we are here, means we have other stuff to do
//do a non blocking select
keyCount = selector.selectNow();
- }else {
- keyCount = selector.keys().size();
- wakeupCounter.set(-1);
+ } else {
keyCount = selector.select(selectorTimeout);
}
wakeupCounter.set(0);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org