Use LinkedTransferQueue for OMATPE

This commit is contained in:
Norman Maurer 2011-11-30 20:14:57 +01:00
parent f6baf157df
commit 9d3828bbe9

View File

@ -16,9 +16,9 @@
package org.jboss.netty.handler.execution; package org.jboss.netty.handler.execution;
import java.util.IdentityHashMap; import java.util.IdentityHashMap;
import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.WeakHashMap; import java.util.WeakHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.ConcurrentMap; import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.Executor; import java.util.concurrent.Executor;
import java.util.concurrent.ThreadFactory; import java.util.concurrent.ThreadFactory;
@ -31,6 +31,7 @@ import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent; import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.util.ObjectSizeEstimator; import org.jboss.netty.util.ObjectSizeEstimator;
import org.jboss.netty.util.internal.ConcurrentIdentityWeakKeyHashMap; import org.jboss.netty.util.internal.ConcurrentIdentityWeakKeyHashMap;
import org.jboss.netty.util.internal.LinkedTransferQueue;
/** /**
* A {@link MemoryAwareThreadPoolExecutor} which makes sure the events from the * A {@link MemoryAwareThreadPoolExecutor} which makes sure the events from the
@ -285,7 +286,7 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
} }
private final class ChildExecutor implements Executor, Runnable { private final class ChildExecutor implements Executor, Runnable {
private final ConcurrentLinkedQueue<Runnable> tasks = new ConcurrentLinkedQueue<Runnable>(); private final Queue<Runnable> tasks = new LinkedTransferQueue<Runnable>();
private final AtomicBoolean isRunning = new AtomicBoolean(false); private final AtomicBoolean isRunning = new AtomicBoolean(false);
ChildExecutor() { ChildExecutor() {