From fe7c2ee97f3b012a6fe3a14f1ee189210d75c4f0 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 5 Jan 2019 16:21:07 +1100 Subject: [PATCH] Identify CraftScheduler threads with useful names By: md_5 --- .../java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java index 557f72d621..61d9febbf7 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java +++ b/paper-server/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;