From d9d488e477c302481bb8fa5028e5bb469eefd492 Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Fri, 28 Aug 2015 21:07:29 +0200 Subject: [PATCH] [#2677] Remove unnessary synchronized in SpdySessionHandler Motivation: As all methods in the ChannelHandler are executed by the same thread there is no need to use synchronized. Modifications: Remove synchronized keyword. Result: No more unnessary synchronized in SpdySessionHandler. --- .../io/netty/handler/codec/spdy/SpdySessionHandler.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java index d34694544e..e5c0848e6c 100644 --- a/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java +++ b/codec-http/src/main/java/io/netty/handler/codec/spdy/SpdySessionHandler.java @@ -699,21 +699,21 @@ public class SpdySessionHandler extends ChannelDuplexHandler { } // need to synchronize to prevent new streams from being created while updating active streams - private synchronized void updateInitialSendWindowSize(int newInitialWindowSize) { + private void updateInitialSendWindowSize(int newInitialWindowSize) { int deltaWindowSize = newInitialWindowSize - initialSendWindowSize; initialSendWindowSize = newInitialWindowSize; spdySession.updateAllSendWindowSizes(deltaWindowSize); } // need to synchronize to prevent new streams from being created while updating active streams - private synchronized void updateInitialReceiveWindowSize(int newInitialWindowSize) { + private void updateInitialReceiveWindowSize(int newInitialWindowSize) { int deltaWindowSize = newInitialWindowSize - initialReceiveWindowSize; initialReceiveWindowSize = newInitialWindowSize; spdySession.updateAllReceiveWindowSizes(deltaWindowSize); } // need to synchronize accesses to sentGoAwayFrame, lastGoodStreamId, and initial window sizes - private synchronized boolean acceptStream( + private boolean acceptStream( int streamId, byte priority, boolean remoteSideClosed, boolean localSideClosed) { // Cannot initiate any new streams after receiving or sending GOAWAY if (receivedGoAwayFrame || sentGoAwayFrame) { @@ -832,7 +832,7 @@ public class SpdySessionHandler extends ChannelDuplexHandler { // FIXME: Close the connection forcibly after timeout. } - private synchronized ChannelFuture sendGoAwayFrame( + private ChannelFuture sendGoAwayFrame( ChannelHandlerContext ctx, SpdySessionStatus status) { if (!sentGoAwayFrame) { sentGoAwayFrame = true;