remm 2005/05/26 07:43:10
Modified: util/java/org/apache/tomcat/util/net AprEndpoint.java
http11/src/java/org/apache/coyote/http11
Http11AprProtocol.java
Log:
- Allow configuring pollTime.
- Use wait/notify for the poller.
Revision Changes Path
1.32 +8 -2
jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java
Index: AprEndpoint.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/util/java/org/apache/tomcat/util/net/AprEndpoint.java,v
retrieving revision 1.31
retrieving revision 1.32
diff -u -r1.31 -r1.32
--- AprEndpoint.java 26 May 2005 09:06:16 -0000 1.31
+++ AprEndpoint.java 26 May 2005 14:43:09 -0000 1.32
@@ -811,6 +811,7 @@
addS[addCount] = socket;
addP[addCount] = pool;
addCount++;
+ addS.notify();
}
}
@@ -834,7 +835,9 @@
while (keepAliveCount < 1 && addCount < 1) {
try {
- Thread.sleep(10);
+ synchronized (addS) {
+ addS.wait();
+ }
} catch (InterruptedException e) {
// Ignore
}
@@ -1153,6 +1156,7 @@
// at most for pollTime before being polled
synchronized (addS) {
addS.add(sendfileData);
+ addS.notify();
}
return false;
}
@@ -1192,7 +1196,9 @@
while (sendfileCount < 1 && addS.size() < 1) {
try {
- Thread.sleep(10);
+ synchronized (addS) {
+ addS.wait();
+ }
} catch (InterruptedException e) {
// Ignore
}
1.7 +9 -0
jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java
Index: Http11AprProtocol.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-connectors/http11/src/java/org/apache/coyote/http11/Http11AprProtocol.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Http11AprProtocol.java 25 May 2005 10:39:28 -0000 1.6
+++ Http11AprProtocol.java 26 May 2005 14:43:09 -0000 1.7
@@ -287,6 +287,15 @@
setAttribute("firstReadTimeout", "" + i);
}
+ public int getPollTime() {
+ return ep.getPollTime();
+ }
+
+ public void setPollTime( int i ) {
+ ep.setPollTime(i);
+ setAttribute("pollTime", "" + i);
+ }
+
public boolean getUseSendfile() {
return ep.getUseSendfile();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]