Code cleanup
This commit is contained in:
parent
7de92967c2
commit
950a386d3f
@ -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) {
|
||||
|
@ -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>();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user