diff options
| author | Matthew Dillon <dillon@FreeBSD.org> | 2002-03-27 05:39:23 +0000 |
|---|---|---|
| committer | Matthew Dillon <dillon@FreeBSD.org> | 2002-03-27 05:39:23 +0000 |
| commit | d74ac6819b2cc8e5c18a099a97ffc16616b4e94d (patch) | |
| tree | 8233f61cf29e01829b91c6a5cf27defe60e6b8d8 /sys/kern/kern_fork.c | |
| parent | 50a565560242eb8b86d01bb62036d501aa4fa52b (diff) | |
Notes
Diffstat (limited to 'sys/kern/kern_fork.c')
| -rw-r--r-- | sys/kern/kern_fork.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/kern/kern_fork.c b/sys/kern/kern_fork.c index d508cbf238c8..723fd62d2825 100644 --- a/sys/kern/kern_fork.c +++ b/sys/kern/kern_fork.c @@ -774,12 +774,16 @@ fork_exit(callout, arg, frame) td->td_kse->ke_oncpu = PCPU_GET(cpuid); /* - * Setup the sched_lock state so that we can release it. + * Finish setting up thread glue. We need to initialize + * the thread into a td_critnest=1 state. Some platforms + * may have already partially or fully initialized td_critnest + * and/or td_md.md_savecrit (when applciable). + * + * see <arch>/<arch>/critical.c */ sched_lock.mtx_lock = (uintptr_t)td; sched_lock.mtx_recurse = 0; - td->td_critnest = 1; - td->td_savecrit = CRITICAL_FORK; + cpu_critical_fork_exit(); CTR3(KTR_PROC, "fork_exit: new proc %p (pid %d, %s)", p, p->p_pid, p->p_comm); if (PCPU_GET(switchtime.sec) == 0) |
