Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_kthread.c
Show All 33 Lines | |||||
#include <sys/cpuset.h> | #include <sys/cpuset.h> | ||||
#include <sys/kthread.h> | #include <sys/kthread.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/resourcevar.h> | #include <sys/resourcevar.h> | ||||
#include <sys/rwlock.h> | #include <sys/rwlock.h> | ||||
#include <sys/signalvar.h> | #include <sys/signalvar.h> | ||||
#include <sys/sysent.h> | |||||
#include <sys/sx.h> | #include <sys/sx.h> | ||||
#include <sys/umtx.h> | #include <sys/umtx.h> | ||||
#include <sys/unistd.h> | #include <sys/unistd.h> | ||||
#include <sys/wait.h> | #include <sys/wait.h> | ||||
#include <sys/sched.h> | #include <sys/sched.h> | ||||
#include <sys/tslog.h> | #include <sys/tslog.h> | ||||
#include <vm/vm.h> | #include <vm/vm.h> | ||||
#include <vm/vm_extern.h> | #include <vm/vm_extern.h> | ||||
▲ Show 20 Lines • Show All 300 Lines • ▼ Show 20 Lines | #endif | ||||
* The last exiting thread in a kernel process must tear down | * The last exiting thread in a kernel process must tear down | ||||
* the whole process. | * the whole process. | ||||
*/ | */ | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
if (p->p_numthreads == 1) { | if (p->p_numthreads == 1) { | ||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
kproc_exit(0); | kproc_exit(0); | ||||
} | } | ||||
if (p->p_sysent->sv_ontdexit != NULL) | |||||
p->p_sysent->sv_ontdexit(td); | |||||
tidhash_remove(td); | tidhash_remove(td); | ||||
umtx_thread_exit(td); | umtx_thread_exit(td); | ||||
tdsigcleanup(td); | tdsigcleanup(td); | ||||
PROC_SLOCK(p); | PROC_SLOCK(p); | ||||
thread_exit(); | thread_exit(); | ||||
} | } | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |