Lines Matching defs:newtd
195 struct thread *newtd;
230 error = kern_thr_alloc(p, 0, &newtd);
234 cpu_copy_thread(newtd, td);
236 bzero(&newtd->td_startzero,
238 newtd->td_pflags2 = 0;
239 newtd->td_errno = 0;
240 bcopy(&td->td_startcopy, &newtd->td_startcopy,
242 newtd->td_proc = td->td_proc;
243 newtd->td_rb_list = newtd->td_rbp_list = newtd->td_rb_inact = 0;
244 thread_cow_get(newtd, td);
246 error = initialize_thread(newtd, thunk);
248 thread_cow_free(newtd);
249 thread_free(newtd);
255 thread_link(newtd, p);
256 bcopy(p->p_comm, newtd->td_name, sizeof(newtd->td_name));
259 sched_fork_thread(td, newtd);
262 newtd->td_flags |= TDF_ASTPENDING | TDF_NEEDSUSPCHK;
264 newtd->td_dbgflags |= TDB_BORN;
269 PMC_CALL_HOOK(newtd, PMC_FN_THR_CREATE, NULL);
271 PMC_CALL_HOOK_UNLOCKED(newtd, PMC_FN_THR_CREATE_LOG, NULL);
274 tidhash_add(newtd);
276 thread_lock(newtd);
280 rtp_to_pri(rtp, newtd);
281 sched_prio(newtd, newtd->td_user_pri);
284 TD_SET_CAN_RUN(newtd);
285 sched_add(newtd, SRQ_BORING);
286 thread_unlock(newtd);