summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authoriedowse <iedowse@FreeBSD.org>2005-02-11 00:14:00 +0000
committeriedowse <iedowse@FreeBSD.org>2005-02-11 00:14:00 +0000
commit6df119b425a233f2f82716d960c919061f54f187 (patch)
treec99053979867e275ecd92b1745ddff702b5500a3 /sys/kern/kern_timeout.c
parent6ffaa0a1012e06b65265e0e8054c0f944dd6b715 (diff)
downloadFreeBSD-src-6df119b425a233f2f82716d960c919061f54f187.zip
FreeBSD-src-6df119b425a233f2f82716d960c919061f54f187.tar.gz
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.
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 a5c7490..f2fafbb 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) {
OpenPOWER on IntegriCloud