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

Function procdesc_free

freebsd/kern/sys_procdesc.c:259–279  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

257}
258
259static void
260procdesc_free(struct procdesc *pd)
261{
262
263 /*
264 * When the last reference is released, we assert that the descriptor
265 * has been closed, but not that the process has exited, as we will
266 * detach the descriptor before the process dies if the descript is
267 * closed, as we can't wait synchronously.
268 */
269 if (refcount_release(&pd->pd_refcount)) {
270 KASSERT(pd->pd_proc == NULL,
271 ("procdesc_free: pd_proc != NULL"));
272 KASSERT((pd->pd_flags & PDF_CLOSED),
273 ("procdesc_free: !PDF_CLOSED"));
274
275 knlist_destroy(&pd->pd_selinfo.si_note);
276 PROCDESC_LOCK_DESTROY(pd);
277 free(pd, M_PROCDESC);
278 }
279}
280
281/*
282 * procdesc_exit() - notify a process descriptor that its process is exiting.

Callers 3

procdesc_exitFunction · 0.85
procdesc_reapFunction · 0.85
procdesc_closeFunction · 0.85

Calls 3

refcount_releaseFunction · 0.85
knlist_destroyFunction · 0.85
freeFunction · 0.70

Tested by

no test coverage detected