2021-06-11 12:02:28 +00:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Aikar <aikar@aikar.co>
Date: Sun, 5 Feb 2017 00:04:04 -0500
Subject: [PATCH] Remove CraftScheduler Async Task Debugger
I have not once ever seen this system help debug a crash.
One report of a suspected memory leak with the system.
This adds additional overhead to asynchronous task dispatching
diff --git a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
2021-07-18 07:41:53 +00:00
index dfc2789009fcaa08baa8054bdac915590b8701d6..d96292052633941102c052894bef747817b2998f 100644
2021-06-11 12:02:28 +00:00
--- a/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
+++ b/src/main/java/org/bukkit/craftbukkit/scheduler/CraftScheduler.java
2021-07-18 07:41:53 +00:00
@@ -445,7 +445,7 @@ public class CraftScheduler implements BukkitScheduler {
2021-06-11 12:02:28 +00:00
}
2021-06-12 09:01:04 +00:00
this.parsePending();
2021-06-11 12:02:28 +00:00
} else {
2021-06-12 09:01:04 +00:00
- this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass()));
+ //this.debugTail = this.debugTail.setNext(new CraftAsyncDebugger(currentTick + CraftScheduler.RECENT_TICKS, task.getOwner(), task.getTaskClass())); // Paper
this.executor.execute(new ServerSchedulerReportingWrapper(task)); // Paper
2021-06-11 12:02:28 +00:00
// We don't need to parse pending
// (async tasks must live with race-conditions if they attempt to cancel between these few lines of code)
2021-07-18 07:41:53 +00:00
@@ -462,7 +462,7 @@ public class CraftScheduler implements BukkitScheduler {
2021-06-12 09:01:04 +00:00
this.pending.addAll(temp);
2021-06-11 12:02:28 +00:00
temp.clear();
2021-06-12 09:01:04 +00:00
MinecraftTimings.bukkitSchedulerFinishTimer.stopTiming(); // Paper
- this.debugHead = this.debugHead.getNextHead(currentTick);
+ //this.debugHead = this.debugHead.getNextHead(currentTick); // Paper
2021-06-11 12:02:28 +00:00
}
private void addTask(final CraftTask task) {
2021-07-18 07:41:53 +00:00
@@ -527,10 +527,15 @@ public class CraftScheduler implements BukkitScheduler {
2021-06-11 12:02:28 +00:00
@Override
public String toString() {
+ // Paper start
+ return "";
+ /*
2021-06-12 09:01:04 +00:00
int debugTick = this.currentTick;
StringBuilder string = new StringBuilder("Recent tasks from ").append(debugTick - CraftScheduler.RECENT_TICKS).append('-').append(debugTick).append('{');
this.debugHead.debugTo(string);
2021-06-11 12:02:28 +00:00
return string.append('}').toString();
+ */
+ // Paper end
}
@Deprecated