From 49bc93eb1118b02e6378e04c2ad69c5b9dd8f06d Mon Sep 17 00:00:00 2001 From: pooka Date: Wed, 9 Mar 2011 18:15:39 +0000 Subject: [PATCH] Mark cv_wait mutex as locked before doing any further dances. Fixes a LOCKDEBUG panic in case the uncommon condition is hit. --- sys/rump/librump/rumpkern/locks.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sys/rump/librump/rumpkern/locks.c b/sys/rump/librump/rumpkern/locks.c index 00a2eaa86b3a..1f43255a12a5 100644 --- a/sys/rump/librump/rumpkern/locks.c +++ b/sys/rump/librump/rumpkern/locks.c @@ -1,4 +1,4 @@ -/* $NetBSD: locks.c,v 1.51 2011/03/08 12:39:29 pooka Exp $ */ +/* $NetBSD: locks.c,v 1.52 2011/03/09 18:15:39 pooka Exp $ */ /* * Copyright (c) 2007, 2008 Antti Kantee. All Rights Reserved. @@ -29,7 +29,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.51 2011/03/08 12:39:29 pooka Exp $"); +__KERNEL_RCSID(0, "$NetBSD: locks.c,v 1.52 2011/03/09 18:15:39 pooka Exp $"); #include #include @@ -305,6 +305,8 @@ docvwait(kcondvar_t *cv, kmutex_t *mtx, struct timespec *ts) rumpuser_cv_wait(RUMPCV(cv), RUMPMTX(mtx)); } + LOCKED(mtx, false); + /* * Check for QEXIT. if so, we need to wait here until we * are allowed to exit. @@ -330,8 +332,6 @@ docvwait(kcondvar_t *cv, kmutex_t *mtx, struct timespec *ts) } l->l_private = NULL; - LOCKED(mtx, false); - return rv; }