scheduleTCB: simplify scheduler action logic

The call to rescheduleRequired within scheduleTCB is performed only when
the scheduler action is ResumeCurrentThread, and therefore will only set
the scheduler action to ChooseNewThread. This removes the call to
rescheduleRequired and replaces it with the direct update to the
scheduler action.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
Signed-off-by: Gerwin Klein <gerwin.klein@proofcraft.systems>
This commit is contained in:
Michael McInerney
2025-12-04 17:11:46 +10:30
committed by Gerwin Klein
parent d3a0f5f7b9
commit 727ccd140f

View File

@@ -586,7 +586,8 @@ void scheduleTCB(tcb_t *tptr)
if (tptr == NODE_STATE(ksCurThread) &&
NODE_STATE(ksSchedulerAction) == SchedulerAction_ResumeCurrentThread &&
!isSchedulable(tptr)) {
rescheduleRequired();
/* short-cut rescheduleRequired(), because we know what the scheduler action is. */
NODE_STATE(ksSchedulerAction) = SchedulerAction_ChooseNewThread;
}
}