From: Jens Axboe Date: Wed, 15 Feb 2012 21:20:26 +0000 (+0100) Subject: Mutex fixes X-Git-Tag: fio-2.0.4~29 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=58a157d466c8e366234b4ee694f28be73e6e7702;ds=sidebyside Mutex fixes Signed-off-by: Jens Axboe --- diff --git a/mutex.c b/mutex.c index 6b4c9fe1..24defcf5 100644 --- a/mutex.c +++ b/mutex.c @@ -15,6 +15,7 @@ void fio_mutex_remove(struct fio_mutex *mutex) { + pthread_cond_destroy(&mutex->cond); munmap((void *) mutex, sizeof(*mutex)); } @@ -57,12 +58,12 @@ struct fio_mutex *fio_mutex_init(int value) #ifdef FIO_HAVE_PSHARED_MUTEX pthread_condattr_setpshared(&cond, PTHREAD_PROCESS_SHARED); #endif - pthread_cond_init(&mutex->cond, &cond); #ifdef FIO_HAVE_CLOCK_MONOTONIC pthread_condattr_setclock(&cond, CLOCK_MONOTONIC); #else pthread_condattr_setclock(&cond, CLOCK_REALTIME); #endif + pthread_cond_init(&mutex->cond, &cond); ret = pthread_mutex_init(&mutex->lock, &attr); if (ret) {