summaryrefslogtreecommitdiff
path: root/sys/kern/kern_timeout.c
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2003-06-20 08:07:15 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2003-06-20 08:07:15 +0000
commitce6912c42044357a7010dec688ed8517212c58e0 (patch)
treed6ebc1271edc0be89aba8c55e8dcb0b2d127eba3 /sys/kern/kern_timeout.c
parenteaaca5deee7db4f28e6f3b782618609647b942be (diff)
Notes
Diffstat (limited to 'sys/kern/kern_timeout.c')
-rw-r--r--sys/kern/kern_timeout.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c
index d789476f2598..be13f97eb8e1 100644
--- a/sys/kern/kern_timeout.c
+++ b/sys/kern/kern_timeout.c
@@ -69,7 +69,9 @@ struct callout_list callfree;
int callwheelsize, callwheelbits, callwheelmask;
struct callout_tailq *callwheel;
int softticks; /* Like ticks, but for softclock(). */
-struct mtx callout_lock;
+#ifdef DIAGNOSTIC
+struct mtx callout_lock, callout_dont_sleep;
+#endif
static struct callout *nextsoftcheck; /* Next callout to be checked. */
@@ -120,6 +122,9 @@ kern_timeout_callwheel_init(void)
TAILQ_INIT(&callwheel[i]);
}
mtx_init(&callout_lock, "callout", NULL, MTX_SPIN | MTX_RECURSE);
+#ifdef DIAGNOSTIC
+ mtx_init(&callout_dont_sleep, "callout_dont_sleep", NULL, MTX_DEF);
+#endif
}
/*
@@ -214,9 +219,11 @@ softclock(void *dummy)
}
#ifdef DIAGNOSTIC
binuptime(&bt1);
+ mtx_lock(&callout_dont_sleep);
#endif
c_func(c_arg);
#ifdef DIAGNOSTIC
+ mtx_unlock(&callout_dont_sleep);
binuptime(&bt2);
bintime_sub(&bt2, &bt1);
if (bt2.frac > maxdt) {