Commit 56c1926
committed
Add list_unlink() for safe node removal from ready queue
Previously, the list operation for removal was limited to
list_remove(), which immediately freed the list node during the
function call. When removing a running task (TASK_RUNNING), the list
node in the ready queue must not be freed because kcb->task_current
shares the same node.
This change introduces list_unlink(), which detaches the node from
the list without freeing it. The unlinked node is returned to the
caller, allowing safe reuse and improving flexibility in dequeue
operations.
This API will be applied in sched_dequeue_task() for safely removing
tasks from ready queues.1 parent 279364e commit 56c1926
1 file changed
+19
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
137 | 156 | | |
138 | 157 | | |
139 | 158 | | |
| |||
0 commit comments