diff options
| author | 2016-03-29 08:46:08 +0000 | |
|---|---|---|
| committer | 2016-03-29 08:46:08 +0000 | |
| commit | 4a0e987ac30b6c005c93f141db1eeb440cceda18 (patch) | |
| tree | 97aef20f540efc77032d7781544e41d1219055ee /sys/kern/kern_exit.c | |
| parent | tweak previous; (diff) | |
| download | wireguard-openbsd-4a0e987ac30b6c005c93f141db1eeb440cceda18.tar.xz wireguard-openbsd-4a0e987ac30b6c005c93f141db1eeb440cceda18.zip | |
Use a macro to check if a thread has a sibling.
Note that without locking a thread cannot claim that it is part
of a multi-threaded process using this macro.
Suggested by miod@, ok guenther@
Diffstat (limited to 'sys/kern/kern_exit.c')
| -rw-r--r-- | sys/kern/kern_exit.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c index 5b36b203922..a66e6b36533 100644 --- a/sys/kern/kern_exit.c +++ b/sys/kern/kern_exit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_exit.c,v 1.155 2016/03/06 05:20:26 guenther Exp $ */ +/* $OpenBSD: kern_exit.c,v 1.156 2016/03/29 08:46:08 mpi Exp $ */ /* $NetBSD: kern_exit.c,v 1.39 1996/04/22 01:38:25 christos Exp $ */ /* @@ -127,8 +127,7 @@ exit1(struct proc *p, int rv, int flags) pr = p->p_p; /* single-threaded? */ - if (TAILQ_FIRST(&pr->ps_threads) == p && - TAILQ_NEXT(p, p_thr_link) == NULL) { + if (!P_HASSIBLING(p)) { flags = EXIT_NORMAL; } else { /* nope, multi-threaded */ |
