Use ChannelEventRunnable where possible. #111

This commit is contained in:
norman 2011-12-15 09:41:08 +01:00
parent b089864650
commit f977f476cf
2 changed files with 6 additions and 6 deletions

View File

@ -363,8 +363,8 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
int increment = settings.objectSizeEstimator.estimateSize(task);
if (task instanceof ChannelUpstreamEventRunnable) {
ChannelUpstreamEventRunnable eventTask = (ChannelUpstreamEventRunnable) task;
if (task instanceof ChannelEventRunnable) {
ChannelEventRunnable eventTask = (ChannelEventRunnable) task;
eventTask.estimatedSize = increment;
Channel channel = eventTask.getEvent().getChannel();
long channelCounter = getChannelCounter(channel).addAndGet(increment);
@ -408,8 +408,8 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
totalLimiter.decrease(increment);
}
if (task instanceof ChannelUpstreamEventRunnable) {
ChannelUpstreamEventRunnable eventTask = (ChannelUpstreamEventRunnable) task;
if (task instanceof ChannelEventRunnable) {
ChannelEventRunnable eventTask = (ChannelEventRunnable) task;
Channel channel = eventTask.getEvent().getChannel();
long channelCounter = getChannelCounter(channel).addAndGet(-increment);
//System.out.println("DC: " + channelCounter + ", " + increment);

View File

@ -234,10 +234,10 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
*/
@Override
protected void doExecute(Runnable task) {
if (!(task instanceof ChannelUpstreamEventRunnable)) {
if (!(task instanceof ChannelEventRunnable)) {
doUnorderedExecute(task);
} else {
ChannelUpstreamEventRunnable r = (ChannelUpstreamEventRunnable) task;
ChannelEventRunnable r = (ChannelEventRunnable) task;
getChildExecutor(r.getEvent()).execute(task);
}
}