* This is called from fork_exit(). Just acquire the correct locks and * let fork do the rest of the work. */
| 2932 | * let fork do the rest of the work. |
| 2933 | */ |
| 2934 | void |
| 2935 | sched_fork_exit(struct thread *td) |
| 2936 | { |
| 2937 | struct tdq *tdq; |
| 2938 | int cpuid; |
| 2939 | |
| 2940 | /* |
| 2941 | * Finish setting up thread glue so that it begins execution in a |
| 2942 | * non-nested critical section with the scheduler lock held. |
| 2943 | */ |
| 2944 | KASSERT(curthread->td_md.md_spinlock_count == 1, |
| 2945 | ("invalid count %d", curthread->td_md.md_spinlock_count)); |
| 2946 | cpuid = PCPU_GET(cpuid); |
| 2947 | tdq = TDQ_SELF(); |
| 2948 | TDQ_LOCK(tdq); |
| 2949 | spinlock_exit(); |
| 2950 | MPASS(td->td_lock == TDQ_LOCKPTR(tdq)); |
| 2951 | td->td_oncpu = cpuid; |
| 2952 | KTR_STATE1(KTR_SCHED, "thread", sched_tdname(td), "running", |
| 2953 | "prio:%d", td->td_priority); |
| 2954 | SDT_PROBE0(sched, , , on__cpu); |
| 2955 | } |
| 2956 | |
| 2957 | /* |
| 2958 | * Create on first use to catch odd startup conditons. |
no test coverage detected