aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authorIan Dowse <iedowse@FreeBSD.org>2005-02-11 00:14:00 +0000
committerIan Dowse <iedowse@FreeBSD.org>2005-02-11 00:14:00 +0000
commit57c037be1c2a9f59cdfd3c237dbe7ddc29540f2c (patch)
treec99053979867e275ecd92b1745ddff702b5500a3 /sys/kern/kern_timeout.c
parentf7167d3e9131616e801e9cd45b373c78d9699aa4 (diff)
downloadsrc-57c037be1c2a9f59cdfd3c237dbe7ddc29540f2c.tar.gz
src-57c037be1c2a9f59cdfd3c237dbe7ddc29540f2c.zip
When processing a timeout() callout and returning it to the free
list, set `curr_callout' to NULL. This ensures that we won't attempt to cancel the current callout if the original callout structure gets recycled while we wait to acquire Giant. This is reported to fix an intermittent syscons problem that was introduced by revision 1.96.
Notes
Notes: svn path=/head/; revision=141674
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r--sys/kern/kern_timeout.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index a5c74907c2a6..f2fafbb85dfa 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -251,11 +251,12 @@ softclock(void *dummy)
c->c_flags = CALLOUT_LOCAL_ALLOC;
SLIST_INSERT_HEAD(&callfree, c,
c_links.sle);
+ curr_callout = NULL;
} else {
c->c_flags =
(c->c_flags & ~CALLOUT_PENDING);
+ curr_callout = c;
}
- curr_callout = c;
curr_cancelled = 0;
mtx_unlock_spin(&callout_lock);
if (c_mtx != NULL) {