Do not try to stop main thread during watchdog shutdown
In Java 21, Thread#stop is no longer implemented and wiill throw an exception when called. As a result, we simply cannot halt the main thread during shutdown anymore.
This commit is contained in:
@@ -108,15 +108,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
|||||||
+ // Paper start - kill main thread, and kill it hard
|
+ // Paper start - kill main thread, and kill it hard
|
||||||
+ shutdownThread = Thread.currentThread();
|
+ shutdownThread = Thread.currentThread();
|
||||||
+ org.spigotmc.WatchdogThread.doStop(); // Paper
|
+ org.spigotmc.WatchdogThread.doStop(); // Paper
|
||||||
+ if (!isSameThread()) {
|
|
||||||
+ MinecraftServer.LOGGER.info("Stopping main thread (Ignore any thread death message you see! - DO NOT REPORT THREAD DEATH TO PAPER)");
|
|
||||||
+ while (this.getRunningThread().isAlive()) {
|
|
||||||
+ this.getRunningThread().stop();
|
|
||||||
+ try {
|
|
||||||
+ Thread.sleep(1);
|
|
||||||
+ } catch (InterruptedException e) {}
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+ // Paper end
|
+ // Paper end
|
||||||
// CraftBukkit end
|
// CraftBukkit end
|
||||||
if (this.metricsRecorder.isRecording()) {
|
if (this.metricsRecorder.isRecording()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user