Skip to content

Commit

Permalink
Fix priority scheduling logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Spottedleaf committed Jul 17, 2024
1 parent 2d5fb18 commit 8bc6b3c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ public PrioritisedExecutor.Priority getEffectivePriority(final PrioritisedExecut
return us == null ? dfl : us;
}
if (us == null) {
return dfl;
return neighbour;
}

return PrioritisedExecutor.Priority.max(us, neighbour);
Expand Down Expand Up @@ -580,7 +580,7 @@ public void recalculateNeighbourPriorities() {

// 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 @@ -611,7 +611,7 @@ public void setPriority(final PrioritisedExecutor.Priority priority) {

// 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

0 comments on commit 8bc6b3c

Please sign in to comment.