Lines Matching refs:newtd
260 * fmt and following will be *printf'd into (*newtd)->td_name (for ps, etc.).
267 struct thread *newtd, *oldtd;
277 newtd = thread_alloc(pages);
278 if (newtd == NULL)
284 bzero(&newtd->td_startzero,
286 newtd->td_pflags2 = 0;
287 newtd->td_errno = 0;
288 bcopy(&oldtd->td_startcopy, &newtd->td_startcopy,
293 vsnprintf(newtd->td_name, sizeof(newtd->td_name), fmt, ap);
296 TSTHREAD(newtd, newtd->td_name);
298 newtd->td_proc = p; /* needed for cpu_copy_thread */
300 cpu_copy_thread(newtd, oldtd);
302 cpu_fork_kthread_handler(newtd, func, arg);
304 newtd->td_pflags |= TDP_KTHREAD;
305 thread_cow_get_proc(newtd, p);
309 thread_link(newtd, p);
312 sched_fork_thread(oldtd, newtd);
313 TD_SET_CAN_RUN(newtd);
317 tidhash_add(newtd);
320 cpuset_kernthread(newtd);
327 thread_lock(newtd);
328 sched_add(newtd, SRQ_BORING);
329 thread_unlock(newtd);
332 *newtdp = newtd;