From d5b7cb35205ebf2955d48381aafb1ca8ee8798e3 Mon Sep 17 00:00:00 2001 From: christos Date: Fri, 2 Dec 2011 23:57:58 +0000 Subject: [PATCH] deal with the proc_lock mutex. --- sys/ddb/db_xxx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/sys/ddb/db_xxx.c b/sys/ddb/db_xxx.c index 0817addd3533..802991553682 100644 --- a/sys/ddb/db_xxx.c +++ b/sys/ddb/db_xxx.c @@ -1,4 +1,4 @@ -/* $NetBSD: db_xxx.c,v 1.64 2011/06/12 03:35:51 rmind Exp $ */ +/* $NetBSD: db_xxx.c,v 1.65 2011/12/02 23:57:58 christos Exp $ */ /* * Copyright (c) 1982, 1986, 1989, 1991, 1993 @@ -37,7 +37,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.64 2011/06/12 03:35:51 rmind Exp $"); +__KERNEL_RCSID(0, "$NetBSD: db_xxx.c,v 1.65 2011/12/02 23:57:58 christos Exp $"); #ifdef _KERNEL_OPT #include "opt_kgdb.h" @@ -106,8 +106,11 @@ db_kill_proc(db_expr_t addr, bool haddr, db_error("?\n"); /*NOTREACHED*/ } - + /* We might stop when the mutex is held or when not */ + t = mutex_tryenter(proc_lock); p = proc_find((pid_t)pid); + if (t) + mutex_exit(proc_lock); if (p == NULL) { db_error("no such proc\n"); /*NOTREACHED*/