From 25c7a783a788b04f148c56f12d6efe1e11d093cd Mon Sep 17 00:00:00 2001 From: Norman Maurer Date: Thu, 21 Feb 2013 15:53:04 +0100 Subject: [PATCH] Fix unneccessary use of EventLoop.execute(..) which gives some nice perf boost and also fix [#1064] as we had a race --- .../io/netty/channel/DefaultChannelHandlerContext.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java index 00c786de2a..eba9f68491 100755 --- a/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelHandlerContext.java @@ -740,7 +740,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements public ChannelHandlerContext fireChannelUnregistered() { final DefaultChannelHandlerContext next = findContextInbound(); EventExecutor executor = next.executor(); - if (prev != null && executor.inEventLoop()) { + if (executor.inEventLoop()) { next.invokeChannelUnregistered(); } else { Runnable task = next.invokeChannelUnregisteredTask; @@ -801,7 +801,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements public ChannelHandlerContext fireChannelInactive() { final DefaultChannelHandlerContext next = findContextInbound(); EventExecutor executor = next.executor(); - if (prev != null && executor.inEventLoop()) { + if (executor.inEventLoop()) { next.invokeChannelInactive(); } else { Runnable task = next.invokeChannelInactiveTask; @@ -836,7 +836,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements final DefaultChannelHandlerContext next = this.next; EventExecutor executor = next.executor(); - if (prev != null && executor.inEventLoop()) { + if (executor.inEventLoop()) { next.invokeExceptionCaught(cause); } else { try { @@ -1463,7 +1463,7 @@ final class DefaultChannelHandlerContext extends DefaultAttributeMap implements void invokeFreeInboundBuffer() { pipeline.inboundBufferFreed = true; EventExecutor executor = executor(); - if (prev != null && executor.inEventLoop()) { + if (executor.inEventLoop()) { invokeFreeInboundBuffer0(); } else { Runnable task = invokeFreeInboundBuffer0Task;