From 0d195e17c8576324e759b9a637f67cd6921c8e46 Mon Sep 17 00:00:00 2001 From: Mike Hearn Date: Fri, 2 Mar 2012 15:32:58 +0100 Subject: [PATCH] Lower the priority of the PeerGroup thread and daemonize it. --- src/com/google/bitcoin/core/PeerGroup.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/com/google/bitcoin/core/PeerGroup.java b/src/com/google/bitcoin/core/PeerGroup.java index 52afc98e..6d630f81 100644 --- a/src/com/google/bitcoin/core/PeerGroup.java +++ b/src/com/google/bitcoin/core/PeerGroup.java @@ -395,6 +395,9 @@ public class PeerGroup { public PeerGroupThread() { super("Peer group thread"); tasks = new LinkedBlockingQueue(); + // Ensure we don't fight with UI threads. + setPriority(Math.max(Thread.MIN_PRIORITY, Thread.currentThread().getPriority() - 1)); + setDaemon(true); } public void run() {