Destroy task. * * @param task Task to be destroyed. * */
| 266 | * |
| 267 | */ |
| 268 | void task_destroy(task_t *task) |
| 269 | { |
| 270 | /* |
| 271 | * Remove the task from the task odict. |
| 272 | */ |
| 273 | irq_spinlock_lock(&tasks_lock, true); |
| 274 | odict_remove(&task->ltasks); |
| 275 | irq_spinlock_unlock(&tasks_lock, true); |
| 276 | |
| 277 | /* |
| 278 | * Perform architecture specific task destruction. |
| 279 | */ |
| 280 | task_destroy_arch(task); |
| 281 | |
| 282 | /* |
| 283 | * Drop our reference to the address space. |
| 284 | */ |
| 285 | as_release(task->as); |
| 286 | |
| 287 | slab_free(task_cache, task); |
| 288 | } |
| 289 | |
| 290 | /** Hold a reference to a task. |
| 291 | * |
no test coverage detected