From 7f6d9d1fb7654643bab8ce04d246e8219d2f34cf Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Sat, 14 Jun 2014 16:01:05 +0100 Subject: [PATCH] Fix the restart command sometimes deadlocking the server --- CraftBukkit-Patches/0057-Watchdog-Thread.patch | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CraftBukkit-Patches/0057-Watchdog-Thread.patch b/CraftBukkit-Patches/0057-Watchdog-Thread.patch index c1e0ded52..ca62736d8 100644 --- a/CraftBukkit-Patches/0057-Watchdog-Thread.patch +++ b/CraftBukkit-Patches/0057-Watchdog-Thread.patch @@ -1,4 +1,4 @@ -From 682ead1a06abe0e2bdf3237c8ffa05c4b260d72e Mon Sep 17 00:00:00 2001 +From c839e6555ebfc524efef5b69ec68d1bc61f18087 Mon Sep 17 00:00:00 2001 From: md_5 Date: Sat, 23 Feb 2013 12:33:20 +1100 Subject: [PATCH] Watchdog Thread. @@ -26,10 +26,10 @@ index 007fb86..51f1761 100644 } diff --git a/src/main/java/org/spigotmc/RestartCommand.java b/src/main/java/org/spigotmc/RestartCommand.java new file mode 100644 -index 0000000..10cb7c4 +index 0000000..429c258 --- /dev/null +++ b/src/main/java/org/spigotmc/RestartCommand.java -@@ -0,0 +1,117 @@ +@@ -0,0 +1,124 @@ +package org.spigotmc; + +import java.io.File; @@ -55,7 +55,14 @@ index 0000000..10cb7c4 + { + if ( testPermission( sender ) ) + { -+ restart(); ++ MinecraftServer.getServer().processQueue.add( new Runnable() ++ { ++ @Override ++ public void run() ++ { ++ restart(); ++ } ++ } ); + } + return true; + }