Skip to content

Commit 1c9ef1e

Browse files
committed
Set dedicated thread name
1 parent 4d5de7a commit 1c9ef1e

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/main/java/me/cortex/voxy/common/thread/UnifiedServiceThreadPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public class UnifiedServiceThreadPool {
1414
private final MultiThreadPrioritySemaphore.Block selfBlock;
1515
private final ThreadGroup dedicatedPool;
1616
private final List<Thread> threads = new ArrayList<>();
17+
private int threadId = 0;
1718

1819
public UnifiedServiceThreadPool() {
1920
this.dedicatedPool = new ThreadGroup("Voxy Dedicated Service");
@@ -33,7 +34,7 @@ public boolean setNumThreads(int threads) {
3334
this.selfBlock.release(-diff);
3435
} else {//Add threads
3536
for (int i = 0; i < diff; i++) {
36-
var t = new Thread(this.dedicatedPool, this::workerThread);
37+
var t = new Thread(this.dedicatedPool, this::workerThread, "Dedicated Voxy Worker #"+(this.threadId++));
3738
t.setPriority(3);
3839
t.setDaemon(true);
3940
this.threads.add(t);

0 commit comments

Comments
 (0)