Fix deadlock occuring when booting vkernel from gdb. One lwp in the vkernel
commit3e6d93ac752aab4f10628449d031e181bee44299
authorNicolas Thery <nth@dragonflybsd.org>
Sun, 13 Jul 2008 10:28:51 +0000 (13 10:28 +0000)
committerNicolas Thery <nth@dragonflybsd.org>
Sun, 13 Jul 2008 10:28:51 +0000 (13 10:28 +0000)
treeab4f48fc9fb575c191d1be9ead5a6333e4a39379
parent789ba984ae41d6fdb964e3fe2c6538026eb66e15
Fix deadlock occuring when booting vkernel from gdb.  One lwp in the vkernel
sends a signal to another one and is preempted by the signal receiving one in
userexit().  As the vkernel is traced, the vkernel process is stopped and the
receiving lwp stops too.  The emitting lwp then resumes and blocks later on a
condition variable.  The gdb process sleeps on wait(2) which never completes
because the emitting lwp is not stopped.

To prevent this, stop lwps in userexit(), after lwkt_reschedule, if their
owning process is stopped.

Reported-by: Simon Schubert <corecode@fs.ei.tum.de>
sys/platform/pc32/i386/trap.c
sys/platform/vkernel/i386/trap.c