Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev replace tsleep with condvar
details: https://anonhg.NetBSD.org/src/rev/135333fbe15d
branches: trunk
changeset: 339898:135333fbe15d
user: mlelstv <mlelstv%NetBSD.org@localhost>
date: Sun Aug 16 14:07:19 2015 +0000
description:
replace tsleep with condvar
diffstat:
sys/dev/ld.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diffs (31 lines):
diff -r a527bfc749f2 -r 135333fbe15d sys/dev/ld.c
--- a/sys/dev/ld.c Sun Aug 16 14:02:52 2015 +0000
+++ b/sys/dev/ld.c Sun Aug 16 14:07:19 2015 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ld.c,v 1.85 2015/08/16 14:02:52 mlelstv Exp $ */
+/* $NetBSD: ld.c,v 1.86 2015/08/16 14:07:19 mlelstv Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.85 2015/08/16 14:02:52 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ld.c,v 1.86 2015/08/16 14:07:19 mlelstv Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -217,9 +217,10 @@
mutex_enter(&sc->sc_mutex);
/* Wait for commands queued with the hardware to complete. */
- if (sc->sc_queuecnt != 0)
- if (tsleep(&sc->sc_queuecnt, PRIBIO, "lddtch", 30 * hz))
+ if (sc->sc_queuecnt != 0) {
+ if (cv_timedwait(&sc->sc_drain, &sc->sc_mutex, 30 * hz))
printf("%s: not drained\n", dksc->sc_xname);
+ }
/* Kill off any queued buffers. */
bufq_drain(dksc->sc_bufq);
Home |
Main Index |
Thread Index |
Old Index