geforkt von Mirrors/Paper
7b0c576798
Allows us much greater control over the Spigot portion of the code and makes us more "proper" Credit to @Dmck2b for originally passing the idea along a while back
24 Zeilen
1.3 KiB
Diff
24 Zeilen
1.3 KiB
Diff
From 3764db804eab7f4953c62610d69a6f2d49bf7d2a Mon Sep 17 00:00:00 2001
|
|
From: md_5 <md_5@live.com.au>
|
|
Date: Tue, 23 Apr 2013 11:50:27 +1000
|
|
Subject: [PATCH] Thread Naming and Tweaks
|
|
|
|
Removes the sleep forever thread and adds useful names for debugging to all staged thread files.
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
index 100c348..a9fdc9f 100644
|
|
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
|
|
@@ -71,7 +71,7 @@ public class CraftScheduler implements BukkitScheduler {
|
|
*/
|
|
private final ConcurrentHashMap<Integer, CraftTask> runners = new ConcurrentHashMap<Integer, CraftTask>();
|
|
private volatile int currentTick = -1;
|
|
- private final Executor executor = Executors.newCachedThreadPool();
|
|
+ private final Executor executor = Executors.newCachedThreadPool(new com.google.common.util.concurrent.ThreadFactoryBuilder().setNameFormat("Craft Scheduler Thread - %1$d").build()); // Spigot
|
|
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;
|
|
--
|
|
1.9.1
|
|
|