Write validate flag (status) after setting timeslice

`mrb_tick()` observes `status == RUNNING` before touching `timeslice`,
so initializing `timeslice` first avoids exposing a partially initialized running state
This commit is contained in:
HASUMI Hitoshi
2026-05-28 19:18:17 +09:00
parent 564726c44f
commit e0d6d39ce9
+1 -1
View File
@@ -323,8 +323,8 @@ execute_task(mrb_state *mrb, mrb_task *t)
uint8_t prev_cci;
/* Set task as running */
t->status = MRB_TASK_STATUS_RUNNING;
t->timeslice = MRB_TIMESLICE_TICK_COUNT;
t->status = MRB_TASK_STATUS_RUNNING;
/* Switch to task context */
prev_c = mrb->c;