Module Name:    src
Committed By:   skrll
Date:           Mon Dec 26 08:16:28 UTC 2016

Modified Files:
        src/sys/arch/xen/xen: xbdback_xenbus.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.62 -r1.63 src/sys/arch/xen/xen/xbdback_xenbus.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/xen/xen/xbdback_xenbus.c
diff -u src/sys/arch/xen/xen/xbdback_xenbus.c:1.62 src/sys/arch/xen/xen/xbdback_xenbus.c:1.63
--- src/sys/arch/xen/xen/xbdback_xenbus.c:1.62	Wed Jan  6 15:28:40 2016
+++ src/sys/arch/xen/xen/xbdback_xenbus.c	Mon Dec 26 08:16:28 2016
@@ -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 @@ xbdback_wakeup_thread(struct xbdback_ins
 	/* only set RUN state when we are WAITING for work */
 	if (xbdi->xbdi_status == WAITING)
 	       xbdi->xbdi_status = RUN;
-	mutex_exit(&xbdi->xbdi_lock);
-
 	cv_broadcast(&xbdi->xbdi_cv);
+	mutex_exit(&xbdi->xbdi_lock);
 }
 
 /*

Reply via email to