diff --git a/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java b/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java index 8b44d2d160..22874bd9b3 100644 --- a/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java +++ b/example/src/main/java/io/netty/example/proxy/HexDumpProxyFrontendHandler.java @@ -29,7 +29,9 @@ public class HexDumpProxyFrontendHandler extends ChannelInboundHandlerAdapter { private final String remoteHost; private final int remotePort; - private volatile Channel outboundChannel; + // As we use inboundChannel.eventLoop() when buildling the Bootstrap this does not need to be volatile as + // the outboundChannel will use the same EventLoop (and therefore Thread) as the inboundChannel. + private Channel outboundChannel; public HexDumpProxyFrontendHandler(String remoteHost, int remotePort) { this.remoteHost = remoteHost;