diff options
Diffstat (limited to 'sys/amd64/amd64/vm_machdep.c')
-rw-r--r-- | sys/amd64/amd64/vm_machdep.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sys/amd64/amd64/vm_machdep.c b/sys/amd64/amd64/vm_machdep.c index dcf4986..0a3bc51 100644 --- a/sys/amd64/amd64/vm_machdep.c +++ b/sys/amd64/amd64/vm_machdep.c @@ -259,6 +259,18 @@ cpu_exit(p) mtx_enter(&sched_lock, MTX_SPIN); mtx_exit(&Giant, MTX_DEF | MTX_NOSWITCH); mtx_assert(&Giant, MA_NOTOWNED); + + /* + * We have to wait until after releasing all locks before + * changing p_stat. If we block on a mutex then we will be + * back at SRUN when we resume and our parent will never + * harvest us. + */ + p->p_stat = SZOMB; + + mp_fixme("assumption: p_pptr won't change at this time"); + wakeup(p->p_pptr); + cnt.v_swtch++; cpu_throw(); panic("cpu_exit"); |