summaryrefslogtreecommitdiff
path: root/kern/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'kern/thread.c')
-rw-r--r--kern/thread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kern/thread.c b/kern/thread.c
index b6a44bb8..c04635b5 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1833,7 +1833,7 @@ thread_init(struct thread *thread, void *stack,
thread->flags |= THREAD_DETACHED;
}
- error = tcb_init(&thread->tcb, stack, fn, arg);
+ error = tcb_build(&thread->tcb, stack, fn, arg);
if (error) {
goto error_tcb;
@@ -1964,6 +1964,7 @@ thread_destroy(struct thread *thread)
turnstile_destroy(thread->priv_turnstile);
sleepq_destroy(thread->priv_sleepq);
thread_free_stack(thread->stack);
+ tcb_cleanup(&thread->tcb);
kmem_cache_free(&thread_cache, thread);
}