From 07adadc4321a82d295e0b4d7f3eaf11133aee634 Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Sat, 12 Jun 2010 09:52:52 -0700 Subject: [PATCH] kernel - Add MTX_INITIALIZER * Add an initializer for static struct mtx declarations --- sys/sys/mutex.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/sys/mutex.h b/sys/sys/mutex.h index 5af49e1357..b17eacd89d 100644 --- a/sys/sys/mutex.h +++ b/sys/sys/mutex.h @@ -74,6 +74,9 @@ struct mtx { typedef struct mtx *mtx_t; +#define MTX_INITIALIZER { .mtx_lock = 0, .mtx_refs = 0, \ + .mtx_owner = NULL, .mtx_link = NULL } + #define MTX_EXCLUSIVE 0x80000000 #define MTX_SHWANTED 0x40000000 #define MTX_EXWANTED 0x20000000 -- 2.41.0