diff options
author | 2012-10-17 04:48:52 +0000 | |
---|---|---|
committer | 2012-10-17 04:48:52 +0000 | |
commit | d67aa6d5b8277fc279ece563973ca1a59b5ff711 (patch) | |
tree | 21fb977378ea6c9b0ca8179a576ef221822e9548 | |
parent | no need for the boot files on the ramdisk. the install script was (diff) | |
download | wireguard-openbsd-d67aa6d5b8277fc279ece563973ca1a59b5ff711.tar.xz wireguard-openbsd-d67aa6d5b8277fc279ece563973ca1a59b5ff711.zip |
If a thread calls __threxit() or _exit() immediately after another
thread coredumps, the former thread needs to be released by the
later single_thread_set(SINGLE_EXIT) call, even though its P_WEXIT
flag is set.
ok kettenis@
-rw-r--r-- | sys/kern/kern_sig.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index c47ef25b4c4..83f353ad3d8 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.143 2012/07/11 08:45:21 guenther Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.144 2012/10/17 04:48:52 guenther Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -1774,8 +1774,19 @@ single_thread_set(struct proc *p, enum single_thread_mode mode, int deep) TAILQ_FOREACH(q, &pr->ps_threads, p_thr_link) { int s; - if (q == p || ISSET(q->p_flag, P_WEXIT)) + if (q == p) continue; + if (q->p_flag & P_WEXIT) { + if (mode == SINGLE_EXIT) { + SCHED_LOCK(s); + if (q->p_stat == SSTOP) { + setrunnable(q); + pr->ps_singlecount++; + } + SCHED_UNLOCK(s); + } + continue; + } SCHED_LOCK(s); atomic_setbits_int(&q->p_flag, P_SUSPSINGLE); switch (q->p_stat) { |