From 77410da7f38c62c82ed676889c96de1f4d972cf6 Mon Sep 17 00:00:00 2001 From: David Gwynne Date: Thu, 2 Jul 2015 23:01:20 +0000 Subject: tweak MUTEX_ASSERT_LOCKED and MUTEX_ASSERT_UNLOCKED to only look at the owner. every other arch does it the same, so this is to reduce differences between our platforms. ok miod@ --- sys/arch/i386/include/mutex.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/arch/i386/include/mutex.h b/sys/arch/i386/include/mutex.h index cfcb0435e62..8fce51d2310 100644 --- a/sys/arch/i386/include/mutex.h +++ b/sys/arch/i386/include/mutex.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mutex.h,v 1.7 2014/03/29 18:09:29 guenther Exp $ */ +/* $OpenBSD: mutex.h,v 1.8 2015/07/02 23:01:19 dlg Exp $ */ /* * Copyright (c) 2004 Artur Grabowski @@ -58,14 +58,12 @@ void __mtx_init(struct mutex *, int); #define mtx_init(mtx, ipl) __mtx_init((mtx), __MUTEX_IPL((ipl))) #define MUTEX_ASSERT_LOCKED(mtx) do { \ - if ((mtx)->mtx_lock != 1 || \ - (mtx)->mtx_owner != curcpu()) \ + if ((mtx)->mtx_owner != curcpu()) \ panic("mutex %p not held in %s", (mtx), __func__); \ } while (0) #define MUTEX_ASSERT_UNLOCKED(mtx) do { \ - if ((mtx)->mtx_lock == 1 && \ - (mtx)->mtx_owner == curcpu()) \ + if ((mtx)->mtx_owner == curcpu()) \ panic("mutex %p held in %s", (mtx), __func__); \ } while (0) -- cgit v1.2.3