summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-08-17 07:13:25 +0000
committerkib <kib@FreeBSD.org>2016-08-17 07:13:25 +0000
commiteed810eb5c6c73ef68a8529d7b2df045caebcceb (patch)
tree876de2ffade533608bc47b3314259de4872386cd
parente07c03288156626bf033777c19c6a56a761ac58e (diff)
downloadFreeBSD-src-eed810eb5c6c73ef68a8529d7b2df045caebcceb.zip
FreeBSD-src-eed810eb5c6c73ef68a8529d7b2df045caebcceb.tar.gz
MFC r303914:
Re-schedule signals after kthread exits.
-rw-r--r--sys/kern/kern_kthread.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/kern/kern_kthread.c b/sys/kern/kern_kthread.c
index 70d95fa..fb46025 100644
--- a/sys/kern/kern_kthread.c
+++ b/sys/kern/kern_kthread.c
@@ -322,11 +322,13 @@ void
kthread_exit(void)
{
struct proc *p;
+ struct thread *td;
- p = curthread->td_proc;
+ td = curthread;
+ p = td->td_proc;
/* A module may be waiting for us to exit. */
- wakeup(curthread);
+ wakeup(td);
/*
* The last exiting thread in a kernel process must tear down
@@ -339,9 +341,10 @@ kthread_exit(void)
rw_wunlock(&tidhash_lock);
kproc_exit(0);
}
- LIST_REMOVE(curthread, td_hash);
+ LIST_REMOVE(td, td_hash);
rw_wunlock(&tidhash_lock);
- umtx_thread_exit(curthread);
+ umtx_thread_exit(td);
+ tdsigcleanup(td);
PROC_SLOCK(p);
thread_exit();
}
OpenPOWER on IntegriCloud