* Initialize type-stable parts of a thread (when newly created). */
| 414 | * Initialize type-stable parts of a thread (when newly created). |
| 415 | */ |
| 416 | static int |
| 417 | thread_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). |
nothing calls this directly
no test coverage detected