Skip to content

Commit f6b0f58

Browse files
committed
Add sched_wakeup_task() in mo_sem_signal()
Previously, mo_sem_signal() only changed the awakened task state to TASK_READY when a semaphore signal was triggered. In the new scheduler design, which selects runnable tasks from ready queues, the awakened task must also be enqueued for scheduling. This change invokes sched_wakeup_task() to perform the enqueue operation, ensuring the awakened task is properly inserted into the ready queue.
1 parent 29b76cf commit f6b0f58

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/semaphore.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ void mo_sem_signal(sem_t *s)
176176
if (likely(awakened_task)) {
177177
/* Validate awakened task state consistency */
178178
if (likely(awakened_task->state == TASK_BLOCKED)) {
179-
awakened_task->state = TASK_READY;
179+
sched_wakeup_task(awakened_task);
180180
should_yield = true;
181181
} else {
182182
/* Task state inconsistency - this should not happen */

0 commit comments

Comments
 (0)