diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2013-12-24 01:11:05 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2013-12-24 01:11:05 +0000 |
commit | 8ca24f2e7be581439eb062b3c660d56126af42d9 (patch) | |
tree | 718e370ffabe9627a710392d2b2bc3715aed61b5 /sys/kern | |
parent | b24f9a61c68d25cdfe68771b0fa9cb1550b66a80 (diff) |
get rid of if (timeout_pending()) timeout_del(). this is racy. any
conditionals you did on timeout_pending can now be done on timeout_del
now that it returns what it did.
ok and a very good fix from kettenis@
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/kern_synch.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/kern/kern_synch.c b/sys/kern/kern_synch.c index 84f0028289a..c480e46f80f 100644 --- a/sys/kern/kern_synch.c +++ b/sys/kern/kern_synch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_synch.c,v 1.111 2013/11/25 15:24:18 tedu Exp $ */ +/* $OpenBSD: kern_synch.c,v 1.112 2013/12/24 01:11:04 dlg Exp $ */ /* $NetBSD: kern_synch.c,v 1.37 1996/04/22 01:38:37 christos Exp $ */ /* @@ -263,9 +263,8 @@ sleep_finish_timeout(struct sleep_state *sls) if (p->p_flag & P_TIMEOUT) { atomic_clearbits_int(&p->p_flag, P_TIMEOUT); return (EWOULDBLOCK); - } else if (timeout_pending(&p->p_sleep_to)) { + } else timeout_del(&p->p_sleep_to); - } return (0); } |