diff options
Diffstat (limited to 'sys/compat/opensolaris/sys/mutex.h')
-rw-r--r-- | sys/compat/opensolaris/sys/mutex.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/compat/opensolaris/sys/mutex.h b/sys/compat/opensolaris/sys/mutex.h index 14e69c4..dac7249 100644 --- a/sys/compat/opensolaris/sys/mutex.h +++ b/sys/compat/opensolaris/sys/mutex.h @@ -48,6 +48,9 @@ typedef struct sx kmutex_t; #define mutex_init(lock, desc, type, arg) do { \ ASSERT((type) == MUTEX_DEFAULT); \ + KASSERT(((lock)->lock_object.lo_flags & LO_ALLMASK) != \ + LO_EXPECTED, ("lock %s already initialized", #lock)); \ + bzero((lock), sizeof(struct sx)); \ sx_init_flags((lock), "zfs:" #lock, SX_DUPOK); \ } while (0) #define mutex_destroy(lock) sx_destroy(lock) |