9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-29 20:09:17 +00:00
Files
Leaf/patches/server/0093-Fix-MC-183518.patch

43 lines
1.9 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: HaHaWTH <102713261+HaHaWTH@users.noreply.github.com>
Date: Fri, 14 Jun 2024 17:34:17 -0400
Subject: [PATCH] Fix-MC-183518
Related MC issue: https://bugs.mojang.com/browse/MC-183518
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
index d0dbe7e3c7c9c2727d5de456808765b2666108e4..95f26facf942e0ce460b2027f39c65dda765113d 100644
--- a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java
@@ -140,8 +140,9 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
}
protected void waitForTasks() {
- Thread.yield();
- LockSupport.parkNanos("waiting for tasks", 100000L);
+ // Leaf start - Fix MC-183518
+ LockSupport.parkNanos("waiting for tasks", 2000000L);
+ // Leaf end
}
protected void doRunTask(R task) {
diff --git a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java.rej b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java.rej
new file mode 100644
index 0000000000000000000000000000000000000000..3a83c5369a6acc0663a66409052c9dfcf36a70f7
--- /dev/null
+++ b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java.rej
@@ -0,0 +1,13 @@
+diff a/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java b/src/main/java/net/minecraft/util/thread/BlockableEventLoop.java (rejected hunks)
+@@ -142,8 +142,9 @@ public abstract class BlockableEventLoop<R extends Runnable> implements Profiler
+ }
+
+ public void waitForTasks() {
+- Thread.yield();
+- LockSupport.parkNanos("waiting for tasks", 100000L);
++ // Leaf start - Fix MC-183518
++ LockSupport.parkNanos("waiting for tasks", 2000000L);
++ // Leaf end
+ }
+
+ protected void doRunTask(R task) {