mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user