Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/xen/xen Hold the interlock before cv_broadcast as p...



details:   https://anonhg.NetBSD.org/src/rev/8e4d81199cae
branches:  trunk
changeset: 819988:8e4d81199cae
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Dec 26 08:16:28 2016 +0000

description:
Hold the interlock before cv_broadcast as per condvar(9)

diffstat:

 sys/arch/xen/xen/xbdback_xenbus.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (29 lines):

diff -r 736800a4e63c -r 8e4d81199cae sys/arch/xen/xen/xbdback_xenbus.c
--- a/sys/arch/xen/xen/xbdback_xenbus.c Mon Dec 26 07:55:00 2016 +0000
+++ b/sys/arch/xen/xen/xbdback_xenbus.c Mon Dec 26 08:16:28 2016 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: xbdback_xenbus.c,v 1.62 2016/01/06 15:28:40 bouyer Exp $      */
+/*      $NetBSD: xbdback_xenbus.c,v 1.63 2016/12/26 08:16:28 skrll Exp $      */
 
 /*
  * Copyright (c) 2006 Manuel Bouyer.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.62 2016/01/06 15:28:40 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xbdback_xenbus.c,v 1.63 2016/12/26 08:16:28 skrll Exp $");
 
 #include <sys/atomic.h>
 #include <sys/buf.h>
@@ -1672,9 +1672,8 @@
        /* only set RUN state when we are WAITING for work */
        if (xbdi->xbdi_status == WAITING)
               xbdi->xbdi_status = RUN;
+       cv_broadcast(&xbdi->xbdi_cv);
        mutex_exit(&xbdi->xbdi_lock);
-
-       cv_broadcast(&xbdi->xbdi_cv);
 }
 
 /*



Home | Main Index | Thread Index | Old Index