From 27de234992dc74bdb8edec2114124454fc5ddc4c Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Tue, 16 Mar 2004 18:56:22 +0000 Subject: [PATCH] Remove a bogus assertion and readd it in a more correct location. A thread might be enqueued on a sleep queue but not be asleep when the timeout fires if it is blocked on a lock trying to check for pending signals before going to sleep. In the case of fixing up the TDF_TIMEOUT race, however, the thread must be marked asleep. Reported by: kan (the bogus one) --- sys/kern/subr_sleepqueue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/kern/subr_sleepqueue.c b/sys/kern/subr_sleepqueue.c index 1dc34097f10..36f68505165 100644 --- a/sys/kern/subr_sleepqueue.c +++ b/sys/kern/subr_sleepqueue.c @@ -667,7 +667,6 @@ sleepq_timeout(void *arg) * synchronize with this function. */ if (TD_ON_SLEEPQ(td)) { - MPASS(TD_IS_SLEEPING(td)); MPASS(td->td_wchan == wchan); MPASS(sq != NULL); td->td_flags |= TDF_TIMEOUT; @@ -688,6 +687,7 @@ sleepq_timeout(void *arg) * need to be canceled. */ if (td->td_flags & TDF_TIMEOUT) { + MPASS(TD_IS_SLEEPING(td)); td->td_flags &= ~TDF_TIMEOUT; TD_CLR_SLEEPING(td); setrunnable(td);