summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/kern_sched.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/kern_sched.c b/sys/kern/kern_sched.c
index 4eb0cf3..afaf6a8 100644
--- a/sys/kern/kern_sched.c
+++ b/sys/kern/kern_sched.c
@@ -318,8 +318,8 @@ sched_exit(void)
struct vas kvas = vm_get_kvas();
intr_mask();
-
td = this_td();
+ spinlock_acquire(&td->lock); /* Never release */
/* Switch back to the kernel address space and destroy ourself */
pmap_switch_vas(vm_get_ctx(), kvas);