diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-06-28 12:08:18 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2022-06-28 12:08:18 +0000 |
commit | 1d140cfee8868666c4cbc19488248ec5e2fc56de (patch) | |
tree | 48599ac886d5af7d3964e529fd7ea9ad5e167eaa /sys | |
parent | f7353d039bec5613185e73f88b803008f2b175ae (diff) |
Cleanup the sleep loop in single_thread_check_locked(). The deep checks
only matter on entry and the pr->ps_single check is done in the while body.
With and OK mpi@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_sig.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 4a104265235..9516b02fb0e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_sig.c,v 1.296 2022/05/13 15:32:00 claudio Exp $ */ +/* $OpenBSD: kern_sig.c,v 1.297 2022/06/28 12:08:17 claudio Exp $ */ /* $NetBSD: kern_sig.c,v 1.54 1996/04/22 01:38:32 christos Exp $ */ /* @@ -2020,18 +2020,15 @@ single_thread_check_locked(struct proc *p, int deep, int s) SCHED_ASSERT_LOCKED(); if (pr->ps_single != NULL && pr->ps_single != p) { - do { - /* if we're in deep, we need to unwind to the edge */ - if (deep) { - if (pr->ps_flags & PS_SINGLEUNWIND) - return (ERESTART); - if (pr->ps_flags & PS_SINGLEEXIT) - return (EINTR); - } - - if (pr->ps_single == NULL) - continue; + /* if we're in deep, we need to unwind to the edge */ + if (deep) { + if (pr->ps_flags & PS_SINGLEUNWIND) + return (ERESTART); + if (pr->ps_flags & PS_SINGLEEXIT) + return (EINTR); + } + do { if (atomic_dec_int_nv(&pr->ps_singlecount) == 0) wakeup(&pr->ps_singlecount); |