From 8fa74ef0035dadb21c4228b5366a7ea8684e598e Mon Sep 17 00:00:00 2001 From: Technus Date: Fri, 17 Apr 2020 07:00:11 +0200 Subject: Add more logging to shutdown --- .../java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/api/threads') diff --git a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java index 727faf29e2..78596ec9ae 100644 --- a/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java +++ b/src/main/java/gregtech/api/threads/GT_Runnable_MachineBlockUpdate.java @@ -35,7 +35,7 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { this.y = aY; this.z = aZ; } - + public static void setMachineUpdateValues(World aWorld, int aX, int aY, int aZ) { EXECUTOR_SERVICE.submit(new GT_Runnable_MachineBlockUpdate(aWorld, aX, aY, aZ)); } @@ -48,8 +48,9 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { } public static void shutdownExecutorService() { - EXECUTOR_SERVICE.shutdown(); // Disable new tasks from being submitted try { + GT_Mod.GT_FML_LOGGER.info("Shutting down Machine block update executor service"); + EXECUTOR_SERVICE.shutdown(); // Disable new tasks from being submitted // Wait a while for existing tasks to terminate if (!EXECUTOR_SERVICE.awaitTermination(60, TimeUnit.SECONDS)) { EXECUTOR_SERVICE.shutdownNow(); // Cancel currently executing tasks @@ -64,6 +65,8 @@ public class GT_Runnable_MachineBlockUpdate implements Runnable { EXECUTOR_SERVICE.shutdownNow(); // Preserve interrupt status Thread.currentThread().interrupt(); + }finally { + GT_Mod.GT_FML_LOGGER.info("Leaving... GT_Runnable_MachineBlockUpdate.shutdownExecutorService"); } } -- cgit