use cv_signal rather than cv_broadcast where appropriate.

This commit is contained in:
yamt 2007-02-11 15:36:35 +00:00
parent 339d48d326
commit be27733fd7
1 changed files with 5 additions and 5 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: subr_workqueue.c,v 1.9 2007/02/09 21:55:31 ad Exp $ */ /* $NetBSD: subr_workqueue.c,v 1.10 2007/02/11 15:36:35 yamt Exp $ */
/*- /*-
* Copyright (c)2002, 2005 YAMAMOTO Takashi, * Copyright (c)2002, 2005 YAMAMOTO Takashi,
@ -27,7 +27,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.9 2007/02/09 21:55:31 ad Exp $"); __KERNEL_RCSID(0, "$NetBSD: subr_workqueue.c,v 1.10 2007/02/11 15:36:35 yamt Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -164,7 +164,7 @@ workqueue_exit(struct work *wk, void *arg)
KASSERT(q->q_worker == curproc); KASSERT(q->q_worker == curproc);
mutex_enter(&q->q_mutex); mutex_enter(&q->q_mutex);
q->q_worker = NULL; q->q_worker = NULL;
cv_broadcast(&q->q_cv); cv_signal(&q->q_cv);
mutex_exit(&q->q_mutex); mutex_exit(&q->q_mutex);
kthread_exit(0); kthread_exit(0);
} }
@ -182,7 +182,7 @@ workqueue_finiqueue(struct workqueue *wq)
KASSERT(q->q_worker != NULL); KASSERT(q->q_worker != NULL);
mutex_enter(&q->q_mutex); mutex_enter(&q->q_mutex);
SIMPLEQ_INSERT_TAIL(&q->q_queue, &wqe.wqe_wk, wk_entry); SIMPLEQ_INSERT_TAIL(&q->q_queue, &wqe.wqe_wk, wk_entry);
cv_broadcast(&q->q_cv); cv_signal(&q->q_cv);
while (q->q_worker != NULL) { while (q->q_worker != NULL) {
cv_wait(&q->q_cv, &q->q_mutex); cv_wait(&q->q_cv, &q->q_mutex);
} }
@ -233,7 +233,7 @@ workqueue_enqueue(struct workqueue *wq, struct work *wk)
mutex_enter(&q->q_mutex); mutex_enter(&q->q_mutex);
if (SIMPLEQ_EMPTY(&q->q_queue)) if (SIMPLEQ_EMPTY(&q->q_queue))
cv_broadcast(&q->q_cv); cv_signal(&q->q_cv);
SIMPLEQ_INSERT_TAIL(&q->q_queue, wk, wk_entry); SIMPLEQ_INSERT_TAIL(&q->q_queue, wk, wk_entry);
mutex_exit(&q->q_mutex); mutex_exit(&q->q_mutex);
} }