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

Function thread_link

freebsd/kern/kern_thread.c:987–1010  ·  view source on GitHub ↗

* Link a thread to a process. * set up anything that needs to be initialized for it to * be used by the process. */

Source from the content-addressed store, hash-verified

985 * be used by the process.
986 */
987void
988thread_link(struct thread *td, struct proc *p)
989{
990
991 /*
992 * XXX This can't be enabled because it's called for proc0 before
993 * its lock has been created.
994 * PROC_LOCK_ASSERT(p, MA_OWNED);
995 */
996 td->td_state = TDS_INACTIVE;
997 td->td_proc = p;
998 td->td_flags = TDF_INMEM;
999
1000 LIST_INIT(&td->td_contested);
1001 LIST_INIT(&td->td_lprof[0]);
1002 LIST_INIT(&td->td_lprof[1]);
1003#ifdef EPOCH_TRACE
1004 SLIST_INIT(&td->td_epochs);
1005#endif
1006 sigqueue_init(&td->td_sigqueue, p);
1007 callout_init(&td->td_slpcallout, 1);
1008 TAILQ_INSERT_TAIL(&p->p_threads, td, td_plist);
1009 p->p_numthreads++;
1010}
1011
1012/*
1013 * Called from:

Callers 3

proc_linkupFunction · 0.85
thread_createFunction · 0.85
kthread_addFunction · 0.85

Calls 2

sigqueue_initFunction · 0.85
callout_initFunction · 0.70

Tested by

no test coverage detected