diff options
author | Jens Axboe <axboe@fb.com> | 2014-12-18 19:44:18 -0700 |
---|---|---|
committer | Mohamad Ayyash <mkayyash@google.com> | 2015-03-06 17:58:10 -0800 |
commit | c180342e1293259ca8d23ed0298aa6c32815fee5 (patch) | |
tree | 836d03507a0e73037d45a56a0f4709be3e36a7cd /mutex.c | |
parent | 32e9adb2bd331309c346fe3289e6a7adedaf9aa6 (diff) | |
download | fio-c180342e1293259ca8d23ed0298aa6c32815fee5.tar.gz |
mutex: add __fio_mutex_remove()
We have to remember to free the condvar, so add a __fio_mutex_remove()
for cases that init a mutex inside an smalloc'ed region with
__fio_mutex_init().
Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'mutex.c')
-rw-r--r-- | mutex.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -18,10 +18,15 @@ #include "fio_time.h" #include "gettime.h" -void fio_mutex_remove(struct fio_mutex *mutex) +void __fio_mutex_remove(struct fio_mutex *mutex) { assert(mutex->magic == FIO_MUTEX_MAGIC); pthread_cond_destroy(&mutex->cond); +} + +void fio_mutex_remove(struct fio_mutex *mutex) +{ + __fio_mutex_remove(mutex); munmap((void *) mutex, sizeof(*mutex)); } |