mcs: Explicitly check that sporadic scs are active

Easier to check this explicitly than prove the invariant.

Signed-off-by: Curtis Millar <curtis@curtism.me>
This commit is contained in:
Curtis Millar
2021-08-02 16:30:38 +10:00
committed by Gerwin Klein
parent 43b2029d02
commit 17109eb8c9

View File

@@ -159,7 +159,10 @@ static inline bool_t sc_released(sched_context_t *sc)
*/
static inline bool_t sc_sporadic(sched_context_t *sc)
{
return sc != NULL && sc->scSporadic;
/* We do expect sc_active to be always true if sc is not NULL when
sc_sporadic is called, but we have not proved it yet. */
assert(sc == NULL || sc_active(sc));
return sc != NULL && sc_active(sc) && sc->scSporadic;
}
/*