Skip to content

Commit bf76c93

Browse files
committed
Refine current-task check in mo_task_suspend()
The previous implementation compared `kcb->task_current` against the task's list node. This is always equivalent to comparing the task's TCB in the current implementation, so no functional behavior is affected and the mismatch can never occur. This change simply makes the intended semantics explicit by comparing against the TCB directly, improving readability and clarifying the abstraction.
1 parent 3d94a32 commit bf76c93

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/task.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ int32_t mo_task_suspend(uint16_t id)
883883
}
884884

885885
task->state = TASK_SUSPENDED;
886-
bool is_current = (kcb->task_current == node);
886+
bool is_current = (kcb->task_current->data == task);
887887

888888
CRITICAL_LEAVE();
889889

0 commit comments

Comments
 (0)