Delete dead code from PeerGroup that was obsoleted by the move to Netty.

This commit is contained in:
Mike Hearn 2012-07-15 15:07:57 +02:00
parent c6d900e91c
commit ba65e7ccf3

View File

@ -33,7 +33,6 @@ import java.net.InetSocketAddress;
import java.net.SocketAddress; import java.net.SocketAddress;
import java.util.*; import java.util.*;
import java.util.concurrent.*; import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import static com.google.common.base.Preconditions.checkArgument; import static com.google.common.base.Preconditions.checkArgument;
import static com.google.common.base.Preconditions.checkNotNull; import static com.google.common.base.Preconditions.checkNotNull;
@ -770,30 +769,4 @@ public class PeerGroup {
return; return;
} }
} }
static class PeerGroupThreadFactory implements ThreadFactory {
static final AtomicInteger poolNumber = new AtomicInteger(1);
final ThreadGroup group;
final AtomicInteger threadNumber = new AtomicInteger(1);
final String namePrefix;
PeerGroupThreadFactory() {
group = Thread.currentThread().getThreadGroup();
namePrefix = "PeerGroup-" +
poolNumber.getAndIncrement() +
"-thread-";
}
public Thread newThread(Runnable r) {
Thread t = new Thread(group, r,
namePrefix + threadNumber.getAndIncrement(),
0);
// Lower the priority of the peer threads. This is to avoid competing with UI threads created by the API
// user when doing lots of work, like downloading the block chain. We select a priority level one lower
// than the parent thread, or the minimum.
t.setPriority(Math.max(Thread.MIN_PRIORITY, Thread.currentThread().getPriority() - 1));
t.setDaemon(true);
return t;
}
}
} }