Use better executors

This commit is contained in:
nostalgic853
2022-12-02 12:02:42 +08:00
parent 4032c984ce
commit bfb566a091
8 changed files with 427 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: MartijnMuijsers <martijnmuijsers@live.nl>
Date: Tue, 29 Nov 2022 13:11:58 +0100
Subject: [PATCH] Remove Paper cleaner executor
License: AGPL-3.0 (https://www.gnu.org/licenses/agpl-3.0.html)
This patch was taken from Gale.
diff --git a/src/main/java/io/papermc/paper/util/MCUtil.java b/src/main/java/io/papermc/paper/util/MCUtil.java
index d5f6fc421bea74b711f99fc14ff916643bfe071a..c6c1b194fdee8841a7745b5ee3ef14e416df02d3 100644
--- a/src/main/java/io/papermc/paper/util/MCUtil.java
+++ b/src/main/java/io/papermc/paper/util/MCUtil.java
@@ -58,14 +58,7 @@ import java.util.function.Supplier;
public final class MCUtil {
public static final Executor asyncExecutor = AsyncExecutor.instance; // Gale - centralized async execution - remove Paper async executor
- public static final ThreadPoolExecutor cleanerExecutor = new ThreadPoolExecutor(
- 1, 1, 0L, TimeUnit.SECONDS,
- new LinkedBlockingQueue<>(),
- new ThreadFactoryBuilder()
- .setNameFormat("Paper Object Cleaner")
- .setUncaughtExceptionHandler(new net.minecraft.DefaultUncaughtExceptionHandlerWithName(MinecraftServer.LOGGER))
- .build()
- );
+ public static final Executor cleanerExecutor = AsyncExecutor.instance; // Gale - centralized async execution - remove Paper cleaner executor
public static final long INVALID_CHUNK_KEY = getCoordinateKey(Integer.MAX_VALUE, Integer.MAX_VALUE);