Code cleanup

This commit is contained in:
Trustin Lee 2008-09-30 01:53:24 +00:00
parent 7de92967c2
commit 950a386d3f
2 changed files with 9 additions and 4 deletions

View File

@ -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) {

View File

@ -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<Runnable> tasks = new LinkedList<Runnable>();