suspend: move call to setThreadState

The call to setThreadState within suspend is
moved to the end of the function, in order to
preserve invariants about the queues.

Signed-off-by: Michael McInerney <michael.mcinerney@proofcraft.systems>
This commit is contained in:
Michael McInerney
2025-12-04 17:08:31 +10:30
committed by Gerwin Klein
parent 19a520a22b
commit 82a1a8f48f

View File

@@ -80,12 +80,12 @@ void suspend(tcb_t *target)
* running */
updateRestartPC(target);
}
setThreadState(target, ThreadState_Inactive);
tcbSchedDequeue(target);
#ifdef CONFIG_KERNEL_MCS
tcbReleaseRemove(target);
schedContext_cancelYieldTo(target);
#endif
setThreadState(target, ThreadState_Inactive);
}
void restart(tcb_t *target)