Skip to content

Commit 265b1be

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 b542b37 commit 265b1be

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
@@ -813,9 +813,8 @@ int32_t mo_task_resume(uint16_t id)
813813
CRITICAL_LEAVE();
814814
return ERR_TASK_CANT_RESUME;
815815
}
816-
817-
/* mark as ready - scheduler will find it */
818-
task->state = TASK_READY;
816+
/* Enqueue resumed task into ready queue */
817+
sched_enqueue_task(task);
819818

820819
CRITICAL_LEAVE();
821820
return ERR_OK;

0 commit comments

Comments
 (0)