diff options
Diffstat (limited to 'kern')
-rw-r--r-- | kern/task.c | 8 | ||||
-rw-r--r-- | kern/task.h | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/kern/task.c b/kern/task.c index 6e8eb5b..000a723 100644 --- a/kern/task.c +++ b/kern/task.c @@ -107,6 +107,14 @@ task_add_thread(struct task *task, struct thread *thread) } void +task_remove_thread(struct task *task, struct thread *thread) +{ + spinlock_lock(&task->lock); + list_remove(&thread->task_node); + spinlock_unlock(&task->lock); +} + +void task_info(struct task *task) { struct thread *thread; diff --git a/kern/task.h b/kern/task.h index 0cebdb2..6759939 100644 --- a/kern/task.h +++ b/kern/task.h @@ -60,6 +60,11 @@ int task_create(struct task **taskp, const char *name); void task_add_thread(struct task *task, struct thread *thread); /* + * Remove a thread from a task. + */ +void task_remove_thread(struct task *task, struct thread *thread); + +/* * Display task information. * * If task is NULL, this function displays all tasks. |