diff options
-rw-r--r-- | sys/kern/kern_timeout.c | 2 | ||||
-rw-r--r-- | sys/kern/subr_sleepqueue.c | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/kern_timeout.c b/sys/kern/kern_timeout.c index 942a78a..0fa898e 100644 --- a/sys/kern/kern_timeout.c +++ b/sys/kern/kern_timeout.c @@ -981,6 +981,8 @@ callout_when(sbintime_t sbt, sbintime_t precision, int flags, spinlock_exit(); #endif #endif + if (cold && to_sbt == 0) + to_sbt = sbinuptime(); if ((flags & C_HARDCLOCK) == 0) to_sbt += tick_sbt; } else diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 94d3e4c..3f637c6 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -386,7 +386,7 @@ sleepq_set_timeout_sbt(void *wchan, sbintime_t sbt, sbintime_t pr, MPASS(TD_ON_SLEEPQ(td)); MPASS(td->td_sleepqueue == NULL); MPASS(wchan != NULL); - if (cold) + if (cold && td == &thread0) panic("timed sleep before timers are working"); KASSERT(td->td_sleeptimo == 0, ("td %d %p td_sleeptimo %jx", td->td_tid, td, (uintmax_t)td->td_sleeptimo)); |