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

Fix priority scheduling logic

This resolves sync loads not being properly prioritised.
This commit is contained in:
Spottedleaf 2024-07-17 07:39:30 -07:00
parent e922317eaa
commit efa4155840

View file

@ -12165,7 +12165,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+ return us == null ? dfl : us;
+ }
+ if (us == null) {
+ return dfl;
+ return neighbour;
+ }
+
+ return PrioritisedExecutor.Priority.max(us, neighbour);
@ -12211,7 +12211,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ // 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);
@ -12242,7 +12242,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
+
+ // 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);