Rework stopping of procs.
authorSimon Schubert <corecode@dragonflybsd.org>
Mon, 12 Mar 2007 21:08:15 +0000 (21:08 +0000)
committerSimon Schubert <corecode@dragonflybsd.org>
Mon, 12 Mar 2007 21:08:15 +0000 (21:08 +0000)
commitf33e86534aed749b02c8a49115cefea3e775741c
tree83a696508dc830a7eacaba4b1abb203ef0a563c2
parentf9366a82a3014027bd834fbf44c9e3fe012e5624
Rework stopping of procs.

Before, proc_stop() would sleep until all running lwps stopped.  This
break when a stop signal is actually coming from the console and is
executed in the context of the idle thread.

Now we count all sleeping threads as stopped and also set LWP_WSTOP to
indicate so.  These threads will stop before return to userland.
Running threads (including the current one) will eventually stop when
returning to userland and will increase p_nstopped.  The last thread
stopping will then send a signal to the parent process.

Discussed-with:  Thomas E. Spanjaard <tgen@netphreax.net>
sys/kern/kern_sig.c
sys/kern/kern_synch.c
sys/sys/proc.h
sys/vfs/procfs/procfs_ctl.c