MCPcopy Create free account
hub / github.com/F-Stack/f-stack / kproc_exit

Function kproc_exit

freebsd/kern/kern_kthread.c:156–182  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156void
157kproc_exit(int ecode)
158{
159 struct thread *td;
160 struct proc *p;
161
162 td = curthread;
163 p = td->td_proc;
164
165 /*
166 * Reparent curthread from proc0 to init so that the zombie
167 * is harvested.
168 */
169 sx_xlock(&proctree_lock);
170 PROC_LOCK(p);
171 proc_reparent(p, initproc, true);
172 PROC_UNLOCK(p);
173 sx_xunlock(&proctree_lock);
174
175 /*
176 * Wakeup anyone waiting for us to exit.
177 */
178 wakeup(p);
179
180 /* Buh-bye! */
181 exit1(td, ecode, 0);
182}
183
184/*
185 * Advise a kernel process to suspend (or resume) in its main loop.

Callers 8

acct_threadFunction · 0.70
soaio_kproc_loopFunction · 0.70
ald_daemonFunction · 0.70
aio_daemonFunction · 0.70
kthread_exitFunction · 0.70
pf_purge_threadFunction · 0.50
bcm2835_audio_workerFunction · 0.50
crypto_finisFunction · 0.50

Calls 3

proc_reparentFunction · 0.85
exit1Function · 0.85
wakeupFunction · 0.70

Tested by

no test coverage detected