Source-Changes-HG archive

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

[src/trunk]: src/sys/kern try to fill ld_locked/ld_unlocked for shared acquis...



details:   https://anonhg.NetBSD.org/src/rev/236b6e636572
branches:  trunk
changeset: 767663:236b6e636572
user:      yamt <yamt%NetBSD.org@localhost>
date:      Tue Jul 26 13:07:20 2011 +0000

description:
try to fill ld_locked/ld_unlocked for shared acquisition of lock

diffstat:

 sys/kern/subr_lockdebug.c |  9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)

diffs (38 lines):

diff -r 0dd75c18fc0f -r 236b6e636572 sys/kern/subr_lockdebug.c
--- a/sys/kern/subr_lockdebug.c Tue Jul 26 13:04:51 2011 +0000
+++ b/sys/kern/subr_lockdebug.c Tue Jul 26 13:07:20 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr_lockdebug.c,v 1.44 2011/04/14 06:12:02 matt Exp $ */
+/*     $NetBSD: subr_lockdebug.c,v 1.45 2011/07/26 13:07:20 yamt Exp $ */
 
 /*-
  * Copyright (c) 2006, 2007, 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.44 2011/04/14 06:12:02 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: subr_lockdebug.c,v 1.45 2011/07/26 13:07:20 yamt Exp $");
 
 #include "opt_ddb.h"
 
@@ -493,6 +493,7 @@
                }
        } else if (shared) {
                l->l_shlocks++;
+               ld->ld_locked = where;
                ld->ld_shares++;
                ld->ld_shwant--;
        } else {
@@ -556,8 +557,10 @@
                }
                l->l_shlocks--;
                ld->ld_shares--;
-               if (ld->ld_lwp == l)
+               if (ld->ld_lwp == l) {
+                       ld->ld_unlocked = where;
                        ld->ld_lwp = NULL;
+               }
                if (ld->ld_cpu == (uint16_t)cpu_index(curcpu()))
                        ld->ld_cpu = (uint16_t)-1;
        } else {



Home | Main Index | Thread Index | Old Index