* Link a thread to a process. * set up anything that needs to be initialized for it to * be used by the process. */
| 985 | * be used by the process. |
| 986 | */ |
| 987 | void |
| 988 | thread_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: |
no test coverage detected