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

Function thread_init

freebsd/kern/kern_thread.c:416–432  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

414 * Initialize type-stable parts of a thread (when newly created).
415 */
416static int
417thread_init(void *mem, int size, int flags)
418{
419 struct thread *td;
420
421 td = (struct thread *)mem;
422
423 td->td_allocdomain = vm_phys_domain(vtophys(td));
424 td->td_sleepqueue = sleepq_alloc();
425 td->td_turnstile = turnstile_alloc();
426 td->td_rlqe = NULL;
427 EVENTHANDLER_DIRECT_INVOKE(thread_init, td);
428 umtx_thread_init(td);
429 td->td_kstack = 0;
430 td->td_sel = NULL;
431 return (0);
432}
433
434/*
435 * Tear down type-stable parts of a thread (just before being discarded).

Callers

nothing calls this directly

Calls 4

vm_phys_domainFunction · 0.85
sleepq_allocFunction · 0.85
turnstile_allocFunction · 0.85
umtx_thread_initFunction · 0.85

Tested by

no test coverage detected