From a3e1271ae1c5fc9ac1f3f60a729ebc5a0acad4da Mon Sep 17 00:00:00 2001 From: RacoonDog <32882447+RacoonDog@users.noreply.github.com> Date: Mon, 15 May 2023 23:22:29 -0400 Subject: [PATCH] Update MeteorExecutor.java --- .../meteorclient/utils/network/MeteorExecutor.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main/java/meteordevelopment/meteorclient/utils/network/MeteorExecutor.java b/src/main/java/meteordevelopment/meteorclient/utils/network/MeteorExecutor.java index adcddfd021..d1ec0d8071 100644 --- a/src/main/java/meteordevelopment/meteorclient/utils/network/MeteorExecutor.java +++ b/src/main/java/meteordevelopment/meteorclient/utils/network/MeteorExecutor.java @@ -9,13 +9,21 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.atomic.AtomicInteger; public class MeteorExecutor { public static ExecutorService executor; @PreInit public static void init() { - executor = Executors.newSingleThreadExecutor(); + AtomicInteger threadNumber = new AtomicInteger(1); + + executor = Executors.newCachedThreadPool((task) -> { + Thread thread = new Thread(task); + thread.setDaemon(true); + thread.setName("Meteor-Executor-" + threadNumber.getAndIncrement()); + return thread; + }); } public static void execute(Runnable task) {