Replaced ConcurrentHashMap with ConcurrentIdentityHashMap wherever possible

This commit is contained in:
Trustin Lee 2009-01-20 08:00:16 +00:00
parent b2d27d3b69
commit a176ae4f3c
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.logging.InternalLogger;
import org.jboss.netty.logging.InternalLoggerFactory;
import org.jboss.netty.util.ConcurrentHashMap;
import org.jboss.netty.util.ConcurrentIdentityHashMap;
import org.jboss.netty.util.LinkedTransferQueue;
/**
@ -90,7 +90,7 @@ public class MemoryAwareThreadPoolExecutor extends ThreadPoolExecutor {
private volatile Settings settings;
private final ConcurrentMap<Channel, AtomicLong> channelCounters =
new ConcurrentHashMap<Channel, AtomicLong>();
new ConcurrentIdentityHashMap<Channel, AtomicLong>();
private final AtomicLong totalCounter = new AtomicLong();
private final Semaphore semaphore = new Semaphore(0);

View File

@ -32,7 +32,7 @@ import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelEvent;
import org.jboss.netty.channel.ChannelState;
import org.jboss.netty.channel.ChannelStateEvent;
import org.jboss.netty.util.ConcurrentHashMap;
import org.jboss.netty.util.ConcurrentIdentityHashMap;
/**
* A {@link MemoryAwareThreadPoolExecutor} which maintains the
@ -66,7 +66,7 @@ public class OrderedMemoryAwareThreadPoolExecutor extends
MemoryAwareThreadPoolExecutor {
private final ConcurrentMap<Channel, Executor> childExecutors =
new ConcurrentHashMap<Channel, Executor>();
new ConcurrentIdentityHashMap<Channel, Executor>();
/**
* Creates a new instance.