File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ public enum Role {
9393 * The amount of bytes still in queue to be sent, at every given time.
9494 * It's updated at every send/sent operation.
9595 */
96- private long bufferQueueTotalAmount = 0 ;
96+ private Long bufferQueueTotalAmount = ( long ) 0 ;
9797
9898 private Draft draft = null ;
9999
@@ -494,7 +494,7 @@ public void flush() throws IOException {
494494 if ( buffer .remaining () > 0 ) {
495495 continue ;
496496 } else {
497- synchronized (this ) {
497+ synchronized (bufferQueueTotalAmount ) {
498498 // subtract this amount of data from the total queued (synchronized over this object)
499499 bufferQueueTotalAmount -= buffer .limit ();
500500 }
@@ -545,7 +545,7 @@ private void channelWrite( ByteBuffer buf ) throws InterruptedException {
545545 if ( DEBUG )
546546 System .out .println ( "write(" + buf .limit () + "): {" + ( buf .limit () > 1000 ? "too big to display" : new String ( buf .array () ) ) + "}" );
547547 buf .rewind ();
548- synchronized (this ) {
548+ synchronized (bufferQueueTotalAmount ) {
549549 // add up the number of bytes to the total queued (synchronized over this object)
550550 bufferQueueTotalAmount += buf .limit ();
551551 }
You can’t perform that action at this time.
0 commit comments