Skip to content

Commit

Permalink
Fix priority scheduling logic
Browse files Browse the repository at this point in the history
This resolves sync loads not being properly prioritised.
  • Loading branch information
Spottedleaf committed Jul 17, 2024
1 parent ceeb8c1 commit 05ed6a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions patches/server/0989-Moonrise-optimisation-patches.patch
Original file line number Diff line number Diff line change
Expand Up @@ -11627,7 +11627,7 @@ index 0000000000000000000000000000000000000000..c1c119e2e788d5963de3a74a6b9724c7
+}
diff --git a/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
new file mode 100644
index 0000000000000000000000000000000000000000..d5fc5756ea960096ff23376a6b7ac68a2a462d22
index 0000000000000000000000000000000000000000..a7ada64a78e36642a6d5ce4a767bff12e675bb16
--- /dev/null
+++ b/src/main/java/ca/spottedleaf/moonrise/patches/chunk_system/scheduling/NewChunkHolder.java
@@ -0,0 +1,2034 @@
Expand Down Expand Up @@ -12165,7 +12165,7 @@ index 0000000000000000000000000000000000000000..d5fc5756ea960096ff23376a6b7ac68a
+ return us == null ? dfl : us;
+ }
+ if (us == null) {
+ return dfl;
+ return neighbour;
+ }
+
+ return PrioritisedExecutor.Priority.max(us, neighbour);
Expand Down Expand Up @@ -12211,7 +12211,7 @@ index 0000000000000000000000000000000000000000..d5fc5756ea960096ff23376a6b7ac68a
+
+ // must hold scheduling lock
+ public void raisePriority(final PrioritisedExecutor.Priority priority) {
+ if (this.priority == null || this.priority.isHigherOrEqualPriority(priority)) {
+ if (this.priority != null && this.priority.isHigherOrEqualPriority(priority)) {
+ return;
+ }
+ this.setPriority(priority);
Expand Down Expand Up @@ -12242,7 +12242,7 @@ index 0000000000000000000000000000000000000000..d5fc5756ea960096ff23376a6b7ac68a
+
+ // must hold scheduling lock
+ public void lowerPriority(final PrioritisedExecutor.Priority priority) {
+ if (this.priority == null || this.priority.isLowerOrEqualPriority(priority)) {
+ if (this.priority != null && this.priority.isLowerOrEqualPriority(priority)) {
+ return;
+ }
+ this.setPriority(priority);
Expand Down Expand Up @@ -25570,7 +25570,7 @@ index 0000000000000000000000000000000000000000..85950a1aa732ab8c01ad28bec9e0de14
+ }
+}
diff --git a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
index 2a5453707bc172d8d0efe3f11959cb0b5f830984..b8499c1cea97a1a88a53053bc7da132f2fd3928d 100644
index 5160dc617cc5037cd3f10479454159f2a9984169..379452394679c466a09441d4c12882d0d00d9ef3 100644
--- a/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
+++ b/src/main/java/io/papermc/paper/configuration/GlobalConfiguration.java
@@ -29,6 +29,45 @@ public class GlobalConfiguration extends ConfigurationPart {
Expand Down

0 comments on commit 05ed6a6

Please sign in to comment.