From fdf16c379057ebf5cb32a511b715b4e8681e5e70 Mon Sep 17 00:00:00 2001 From: Technici4n <13494793+Technici4n@users.noreply.github.com> Date: Sat, 20 Apr 2024 01:08:05 +0200 Subject: [PATCH] Make the sync worker thread a deamon thread (#117) --- loader/src/main/java/net/neoforged/fml/ModWorkManager.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loader/src/main/java/net/neoforged/fml/ModWorkManager.java b/loader/src/main/java/net/neoforged/fml/ModWorkManager.java index 1428f767..bca42591 100644 --- a/loader/src/main/java/net/neoforged/fml/ModWorkManager.java +++ b/loader/src/main/java/net/neoforged/fml/ModWorkManager.java @@ -18,7 +18,11 @@ public class ModWorkManager { private static final Logger LOGGER = LogManager.getLogger(); - private static final Executor syncWorkExecutor = Executors.newSingleThreadExecutor(r -> new Thread(r, "modloading-sync-worker")); + private static final Executor syncWorkExecutor = Executors.newSingleThreadExecutor(r -> { + var thread = new Thread(r, "modloading-sync-worker"); + thread.setDaemon(true); + return thread; + }); /** * Executor that runs tasks on a single thread in the order they are submitted.