From: fhanik Date: Wed, 21 Feb 2007 03:47:05 +0000 (+0000) Subject: added in notes to myself about blocking the poller thread, that should be prohibited X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=9300d03df23399bdbc4e4d08664c647802a1a961;p=tomcat7.0 added in notes to myself about blocking the poller thread, that should be prohibited git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@509880 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/NioBlockingSelector.java b/java/org/apache/tomcat/util/net/NioBlockingSelector.java index e046caa6d..b9519cb35 100644 --- a/java/org/apache/tomcat/util/net/NioBlockingSelector.java +++ b/java/org/apache/tomcat/util/net/NioBlockingSelector.java @@ -68,6 +68,7 @@ public class NioBlockingSelector { att.startLatch(1); socket.getPoller().add(socket,SelectionKey.OP_WRITE); att.getLatch().await(writeTimeout,TimeUnit.MILLISECONDS); + att.resetLatch(); }catch (InterruptedException ignore) { } if ( att.getLatch() == null ) keycount = 1; @@ -124,6 +125,7 @@ public class NioBlockingSelector { att.startLatch(1); socket.getPoller().add(socket,SelectionKey.OP_READ); att.getLatch().await(readTimeout,TimeUnit.MILLISECONDS); + att.resetLatch(); }catch (InterruptedException ignore) { } if ( att.getLatch() == null ) keycount = 1; diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index f6f51c5a2..c40b29c2c 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -876,7 +876,6 @@ public class NioEndpoint { } } } - } @@ -1270,8 +1269,10 @@ public class NioEndpoint { processSocket(channel, SocketStatus.DISCONNECT); } else if ( attachment.getLatch() != null ) { attachment.getLatch().countDown(); - attachment.resetLatch(); } else { + //this sucker here dead locks with the count down latch + //since this call is blocking if no threads are available. + //TODO: FIXME BIG TIME boolean close = (!processSocket(channel)); if ( close ) { channel.close();