tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1488790 - /tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
Date Sun, 02 Jun 2013 21:08:57 GMT
Author: markt
Date: Sun Jun  2 21:08:57 2013
New Revision: 1488790

URL: http://svn.apache.org/r1488790
Log:
Ensure consistent view of flipped and bbuf when doing non-blocking writes

Modified:
    tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java

Modified: tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java
URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java?rev=1488790&r1=1488789&r2=1488790&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java (original)
+++ tomcat/trunk/java/org/apache/coyote/http11/InternalAprOutputBuffer.java Sun Jun  2 21:08:57
2013
@@ -249,7 +249,7 @@ public class InternalAprOutputBuffer ext
     }
 
 
-    private void writeToSocket(boolean block) throws IOException {
+    private synchronized void writeToSocket(boolean block) throws IOException {
 
         Lock readLock = wrapper.getBlockingStatusReadLock();
         WriteLock writeLock = wrapper.getBlockingStatusWriteLock();
@@ -291,7 +291,7 @@ public class InternalAprOutputBuffer ext
         }
     }
 
-    private void writeToSocket() throws IOException {
+    private synchronized void writeToSocket() throws IOException {
         if (!flipped) {
             flipped = true;
             bbuf.flip();
@@ -332,7 +332,7 @@ public class InternalAprOutputBuffer ext
     //-------------------------------------------------- Non-blocking IO methods
 
     @Override
-    protected boolean hasMoreDataToFlush() {
+    protected synchronized boolean hasMoreDataToFlush() {
         return (flipped && bbuf.remaining() > 0) ||
                 (!flipped && bbuf.position() > 0);
     }



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message