From 950a386d3f1bd884350ffe27dd0cd47255c4c409 Mon Sep 17 00:00:00 2001 From: Trustin Lee Date: Tue, 30 Sep 2008 01:53:24 +0000 Subject: [PATCH] Code cleanup --- .../handler/execution/MemoryAwareThreadPoolExecutor.java | 4 ---- .../execution/OrderedMemoryAwareThreadPoolExecutor.java | 9 +++++++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jboss/netty/handler/execution/MemoryAwareThreadPoolExecutor.java b/src/main/java/org/jboss/netty/handler/execution/MemoryAwareThreadPoolExecutor.java index 06d9f409d9..4fa70a6f82 100644 --- a/src/main/java/org/jboss/netty/handler/execution/MemoryAwareThreadPoolExecutor.java +++ b/src/main/java/org/jboss/netty/handler/execution/MemoryAwareThreadPoolExecutor.java @@ -374,10 +374,6 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor { * make sure important tasks are not counted. */ protected boolean shouldCount(Runnable task) { - if (task instanceof Executor) { - return false; - } - if (task instanceof ChannelEventRunnable) { ChannelEventRunnable r = (ChannelEventRunnable) task; if (r.getEvent() instanceof ChannelStateEvent) { diff --git a/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java b/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java index 7d6ef2aef7..062bf22c5f 100644 --- a/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java +++ b/src/main/java/org/jboss/netty/handler/execution/OrderedMemoryAwareThreadPoolExecutor.java @@ -168,6 +168,15 @@ public class OrderedMemoryAwareThreadPoolExecutor extends return executor; } + @Override + protected boolean shouldCount(Runnable task) { + if (task instanceof ChildExecutor) { + return false; + } + + return super.shouldCount(task); + } + private class ChildExecutor implements Executor, Runnable { private final LinkedList tasks = new LinkedList();