From 9c5b52907227f8f50dc472d11601869f75b8d663 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 3 Mar 2008 11:08:19 +0100 Subject: [PATCH] Add rw mutex init helper Signed-off-by: Jens Axboe --- mutex.h | 5 +++++ smalloc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/mutex.h b/mutex.h index 74515936..40cfc1ed 100644 --- a/mutex.h +++ b/mutex.h @@ -20,4 +20,9 @@ extern void fio_mutex_up(struct fio_mutex *); extern void fio_mutex_up_read(struct fio_mutex *); extern void fio_mutex_up_write(struct fio_mutex *); +static inline struct fio_mutex *fio_mutex_rw_init(void) +{ + return fio_mutex_init(0); +} + #endif diff --git a/smalloc.c b/smalloc.c index e6f89b2d..9a7c25bf 100644 --- a/smalloc.c +++ b/smalloc.c @@ -271,7 +271,7 @@ void sinit(void) int ret = add_pool(&mp[0]); #ifdef MP_SAFE - lock = fio_mutex_init(1); + lock = fio_mutex_rw_init(); #endif assert(!ret); } -- 2.25.1