From a610dcd821c590cfc1ceb5fcb284c595d78b2554 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 5 Jan 2019 16:21:07 +1100 Subject: [PATCH] Identify CraftScheduler threads with useful names --- .../java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 557f72d621..61d9febbf7 100644 --- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java @@ -1,5 +1,6 @@ package org.bukkit.craftbukkit.scheduler; +import com.google.common.util.concurrent.ThreadFactoryBuilder; import java.util.ArrayList; import java.util.Comparator; import java.util.Iterator; @@ -80,7 +81,7 @@ public class CraftScheduler implements BukkitScheduler { */ private volatile CraftTask currentTask = null; private volatile int currentTick = -1; - private final Executor executor = Executors.newCachedThreadPool(); + private final Executor executor = Executors.newCachedThreadPool(new ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %d").build()); private CraftAsyncDebugger debugHead = new CraftAsyncDebugger(-1, null, null) {@Override StringBuilder debugTo(StringBuilder string) {return string;}}; private CraftAsyncDebugger debugTail = debugHead; private static final int RECENT_TICKS;