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

Function proc_init

freebsd/kern/kern_proc.c:262–279  ·  view source on GitHub ↗

* Initialize type-stable parts of a proc (when newly created). */

Source from the content-addressed store, hash-verified

260 * Initialize type-stable parts of a proc (when newly created).
261 */
262static int
263proc_init(void *mem, int size, int flags)
264{
265 struct proc *p;
266
267 p = (struct proc *)mem;
268 mtx_init(&p->p_mtx, "process lock", NULL, MTX_DEF | MTX_DUPOK | MTX_NEW);
269 mtx_init(&p->p_slock, "process slock", NULL, MTX_SPIN | MTX_NEW);
270 mtx_init(&p->p_statmtx, "pstatl", NULL, MTX_SPIN | MTX_NEW);
271 mtx_init(&p->p_itimmtx, "pitiml", NULL, MTX_SPIN | MTX_NEW);
272 mtx_init(&p->p_profmtx, "pprofl", NULL, MTX_SPIN | MTX_NEW);
273 cv_init(&p->p_pwait, "ppwait");
274 TAILQ_INIT(&p->p_threads); /* all threads in proc */
275 EVENTHANDLER_DIRECT_INVOKE(process_init, p);
276 p->p_stats = pstats_alloc();
277 p->p_pgrp = NULL;
278 return (0);
279}
280
281/*
282 * UMA should ensure that this function is never called.

Callers

nothing calls this directly

Calls 3

mtx_initFunction · 0.85
pstats_allocFunction · 0.85
cv_initFunction · 0.70

Tested by

no test coverage detected