Add more informative thread names

This commit is contained in:
AsamK 2022-01-29 15:01:34 +01:00
parent 2e74acaabe
commit 380c892e24
4 changed files with 21 additions and 6 deletions

View file

@ -81,6 +81,7 @@ import java.util.Set;
import java.util.UUID;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Function;
import java.util.stream.Collectors;
@ -749,6 +750,8 @@ public class ManagerImpl implements Manager {
}
}
private static final AtomicInteger threadNumber = new AtomicInteger(0);
private void startReceiveThreadIfRequired() {
if (receiveThread != null) {
return;
@ -784,6 +787,7 @@ public class ManagerImpl implements Manager {
}
}
});
receiveThread.setName("receive-" + threadNumber.getAndIncrement());
receiveThread.start();
}

View file

@ -62,6 +62,7 @@ public class MessageSendLogStore implements AutoCloseable {
logger.debug("Stopping msl cleanup thread");
}
});
cleanupThread.setName("msl-cleanup");
cleanupThread.setDaemon(true);
cleanupThread.start();
}