Skip to content

Commit e813dd9

Browse files
committed
Add sched_enqueue_task() in mo_task_resume()
Previously, mo_task_resume() only changed resumed task state to TASK_READY, but didn't enqueue it into ready queue. As a result, the scheduler could not select the resumed task for execution. This change adds sched_enqueue_task() to insert the resumed task into the appropriate ready queue and update the ready bitmap, ensuring the resumed task becomes schedulable again.
1 parent 7171771 commit e813dd9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

kernel/task.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -818,9 +818,8 @@ int32_t mo_task_resume(uint16_t id)
818818
CRITICAL_LEAVE();
819819
return ERR_TASK_CANT_RESUME;
820820
}
821-
822-
/* mark as ready - scheduler will find it */
823-
task->state = TASK_READY;
821+
/* Enqueue resumed task into ready queue */
822+
sched_enqueue_task(task);
824823

825824
CRITICAL_LEAVE();
826825
return ERR_OK;

0 commit comments

Comments
 (0)