Skip to content

Commit 59512ad

Browse files
committed
Add enqueuing path in mo_mutex_signal()
This commit adds enqueuing path for awakened task when mo_mutex_signal() is called; the mo_wake_up() API adds in header file for enqueuing operation.
1 parent 71ba699 commit 59512ad

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

include/sys/task.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -303,3 +303,6 @@ void _sched_block(queue_t *wait_q);
303303
* Returns 'true' to enable preemptive scheduling, or 'false' for cooperative
304304
*/
305305
int32_t app_main(void);
306+
307+
/* Wake up and enqueue task into ready queue */
308+
void sched_wakeup_task(tcb_t *);

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)