1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-02-16 18:31:53 +01:00

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:
Spottedleaf 2024-07-15 12:46:23 -07:00
parent 043559513c
commit e3d92c508f

View file

@ -108,15 +108,6 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ // Paper start - kill main thread, and kill it hard
+ shutdownThread = Thread.currentThread();
+ 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
// CraftBukkit end
if (this.metricsRecorder.isRecording()) {