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 436df07a..41d996b4 100644
--- a/kern/thread.c
+++ b/kern/thread.c
@@ -1884,9 +1884,10 @@ thread_destroy(struct thread *thread)
thread_unlock_runq(runq, flags);
} while (state != THREAD_DEAD);
- thread_destroy_tsd(thread);
+ /* See task_info() */
task_remove_thread(thread->task, thread);
+ thread_destroy_tsd(thread);
turnstile_destroy(thread->priv_turnstile);
sleepq_destroy(thread->priv_sleepq);
kmem_cache_free(&thread_stack_cache, thread->stack);