summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
authordyson <dyson@FreeBSD.org>1997-06-16 00:29:36 +0000
committerdyson <dyson@FreeBSD.org>1997-06-16 00:29:36 +0000
commit1dcc2689e70c9a1ef6ab3fdc4cd16d3ccaa83c7d (patch)
treee5651aa05b6b49b6cd9fe5e8b7a44c6f4b09b6ee /sys/kern/kern_exit.c
parent195ce8e1d024251eb78a9b82a8ab980dadb12efe (diff)
downloadFreeBSD-src-1dcc2689e70c9a1ef6ab3fdc4cd16d3ccaa83c7d.zip
FreeBSD-src-1dcc2689e70c9a1ef6ab3fdc4cd16d3ccaa83c7d.tar.gz
Modifications to existing files to support the initial AIO/LIO and
kernel based threading support.
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c33
1 files changed, 32 insertions, 1 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index efe1dc6..e5be44e 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -36,7 +36,7 @@
* SUCH DAMAGE.
*
* @(#)kern_exit.c 8.7 (Berkeley) 2/12/94
- * $Id: kern_exit.c,v 1.47 1997/04/07 07:16:00 peter Exp $
+ * $Id: kern_exit.c,v 1.48 1997/05/22 07:25:20 phk Exp $
*/
#include "opt_ktrace.h"
@@ -125,6 +125,37 @@ exit1(p, rv)
WTERMSIG(rv), WEXITSTATUS(rv));
panic("Going nowhere without my init!");
}
+
+ /* are we a task leader? */
+ if(p == p->p_leader) {
+ struct kill_args killArgs;
+ killArgs.signum = SIGKILL;
+ q = p->p_peers;
+ while(q) {
+ killArgs.pid = q->p_pid;
+ /*
+ * The interface for kill is better
+ * than the internal signal
+ */
+ kill(p, &killArgs, &rv);
+ nq = q;
+ q = q->p_peers;
+ /*
+ * orphan the threads so we don't mess up
+ * when they call exit
+ */
+ nq->p_peers = 0;
+ nq->p_leader = nq;
+ }
+
+ /* otherwise are we a peer? */
+ } else if(p->p_peers) {
+ q = p->p_leader;
+ while(q->p_peers != p)
+ q = q->p_peers;
+ q->p_peers = p->p_peers;
+ }
+
#ifdef PGINPROF
vmsizmon();
#endif
OpenPOWER on IntegriCloud