diff --git a/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoopGroup.java b/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoopGroup.java index 847cd7e8a5..6b9f855624 100644 --- a/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoopGroup.java +++ b/transport/src/main/java/io/netty/channel/socket/aio/AioEventLoopGroup.java @@ -110,28 +110,6 @@ public class AioEventLoopGroup extends MultithreadEventLoopGroup { return new AioEventLoop(this, threadFactory, scheduler); } - private void executeAioTask(Runnable command) { - AbstractAioChannel ch = null; - try { - ch = CHANNEL_FINDER.findChannel(command); - } catch (Throwable t) { - // Ignore - } - - EventExecutor l; - if (ch != null) { - l = ch.eventLoop(); - } else { - l = next(); - } - - if (l.isShutdown()) { - command.run(); - } else { - l.execute(command); - } - } - private final class AioExecutorService extends AbstractExecutorService { // It does not shut down the underlying EventExecutor - it merely pretends to be shut down. @@ -173,5 +151,27 @@ public class AioEventLoopGroup extends MultithreadEventLoopGroup { next().execute(command); } } + + private void executeAioTask(Runnable command) { + AbstractAioChannel ch = null; + try { + ch = CHANNEL_FINDER.findChannel(command); + } catch (Throwable t) { + // Ignore + } + + EventExecutor l; + if (ch != null) { + l = ch.eventLoop(); + } else { + l = next(); + } + + if (l.isShutdown()) { + command.run(); + } else { + l.execute(command); + } + } } }