Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/puffs Hold the interlock when calling cv_broadcast as...



details:   https://anonhg.NetBSD.org/src/rev/65309ea15d8e
branches:  trunk
changeset: 349847:65309ea15d8e
user:      skrll <skrll%NetBSD.org@localhost>
date:      Mon Dec 26 08:21:09 2016 +0000

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

diffstat:

 sys/fs/puffs/puffs_msgif.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (29 lines):

diff -r 76f60191a3ee -r 65309ea15d8e sys/fs/puffs/puffs_msgif.c
--- a/sys/fs/puffs/puffs_msgif.c        Mon Dec 26 08:16:28 2016 +0000
+++ b/sys/fs/puffs/puffs_msgif.c        Mon Dec 26 08:21:09 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: puffs_msgif.c,v 1.99 2016/07/07 06:55:42 msaitoh Exp $ */
+/*     $NetBSD: puffs_msgif.c,v 1.100 2016/12/26 08:21:09 skrll Exp $  */
 
 /*
  * Copyright (c) 2005, 2006, 2007  Antti Kantee.  All Rights Reserved.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.99 2016/07/07 06:55:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: puffs_msgif.c,v 1.100 2016/12/26 08:21:09 skrll Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -429,9 +429,9 @@
        park->park_flags |= PARKFLAG_ONQUEUE1;
        pmp->pmp_msg_touser_count++;
        park->park_refcount++;
-       mutex_exit(&pmp->pmp_lock);
 
        cv_broadcast(&pmp->pmp_msg_waiter_cv);
+       mutex_exit(&pmp->pmp_lock);
        putter_notify(pmp->pmp_pi);
 
        DPRINTF(("touser: req %" PRIu64 ", preq: %p, park: %p, "



Home | Main Index | Thread Index | Old Index