aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/kern_condvar.c
diff options
context:
space:
mode:
authorJulian Elischer <julian@FreeBSD.org>2002-07-02 05:33:46 +0000
committerJulian Elischer <julian@FreeBSD.org>2002-07-02 05:33:46 +0000
commitd5cb7e14f64a5208236e1223e04c7ac01f16bac7 (patch)
treeb13b99820ab537d7f1504cd043071e8a42e5660a /sys/kern/kern_condvar.c
parent4ec593593a4df4ed4aa7f1c3b9a3526acae5f702 (diff)
downloadsrc-d5cb7e14f64a5208236e1223e04c7ac01f16bac7.tar.gz
src-d5cb7e14f64a5208236e1223e04c7ac01f16bac7.zip
Fix failure to correctly transition back to sleep mode.
Notes
Notes: svn path=/head/; revision=99247
Diffstat (limited to 'sys/kern/kern_condvar.c')
-rw-r--r--sys/kern/kern_condvar.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/kern/kern_condvar.c b/sys/kern/kern_condvar.c
index 78585b28da6a..9771077bbbd6 100644
--- a/sys/kern/kern_condvar.c
+++ b/sys/kern/kern_condvar.c
@@ -394,8 +394,10 @@ cv_timedwait(struct cv *cvp, struct mtx *mp, int timo)
/*
* Work around race with cv_timedwait_end similar to that
* between msleep and endtsleep.
+ * Go back to sleep.
*/
td->td_flags |= TDF_TIMEOUT;
+ td->td_state = TDS_SLP;
td->td_proc->p_stats->p_ru.ru_nivcsw++;
mi_switch();
}
@@ -470,8 +472,10 @@ cv_timedwait_sig(struct cv *cvp, struct mtx *mp, int timo)
/*
* Work around race with cv_timedwait_end similar to that
* between msleep and endtsleep.
+ * Go back to sleep.
*/
td->td_flags |= TDF_TIMEOUT;
+ td->td_state = TDS_SLP;
td->td_proc->p_stats->p_ru.ru_nivcsw++;
mi_switch();
}