diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2020-10-23 20:28:10 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2020-10-23 20:28:10 +0000 |
commit | 5299adf11cf6980afd43bfd40ef32e90154811ca (patch) | |
tree | 208dc52612e7276e5cac66186cb7d91632f44c03 /sys | |
parent | b98db7cb98a937ab625610f859e9d7e53998c139 (diff) |
sleep_setup_timeout(): always KASSERT that P_TIMEOUT is unset
Even if we aren't setting a timeout, P_TIMEOUT should not be set at
this point in the sleep.
ok visa@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_synch.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 6d65d7fee19..f0338e8f90f 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.170 2020/04/06 07:52:12 claudio Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.171 2020/10/23 20:28:09 cheloha Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -434,8 +434,9 @@ sleep_setup_timeout(struct sleep_state *sls, int timo) { struct proc *p = curproc; + KASSERT((p->p_flag & P_TIMEOUT) == 0); + if (timo) { - KASSERT((p->p_flag & P_TIMEOUT) == 0); sls->sls_timeout = 1; timeout_add(&p->p_sleep_to, timo); } |