directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From trus...@apache.org
Subject svn commit: r358795 - /directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java
Date Fri, 23 Dec 2005 11:47:29 GMT
Author: trustin
Date: Fri Dec 23 03:47:24 2005
New Revision: 358795

URL: http://svn.apache.org/viewcvs?rev=358795&view=rev
Log:
Fixed: concurrency issue when user writes messages from multiple threads at the same time

Modified:
    directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java

Modified: directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java
URL: http://svn.apache.org/viewcvs/directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java?rev=358795&r1=358794&r2=358795&view=diff
==============================================================================
--- directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java
(original)
+++ directory/network/trunk/src/java/org/apache/mina/filter/codec/support/SimpleProtocolEncoderOutput.java
Fri Dec 23 03:47:24 2005
@@ -27,12 +27,12 @@
         return bufferQueue;
     }
     
-    public void write( ByteBuffer buf )
+    public synchronized void write( ByteBuffer buf )
     {
         bufferQueue.push( buf );
     }
     
-    public void mergeAll()
+    public synchronized void mergeAll()
     {
         int sum = 0;
         final int size = bufferQueue.size();
@@ -70,7 +70,7 @@
         bufferQueue.push(newBuf);
     }
     
-    public WriteFuture flush()
+    public synchronized WriteFuture flush()
     {
         Queue bufferQueue = this.bufferQueue;
         WriteFuture future = null;



Mime
View raw message