X-Git-Url: https://git.kernel.dk/?p=fio.git;a=blobdiff_plain;f=mutex.c;h=e5b045ec91bc0348234eff8cf3f5ff265a9253cf;hp=758092218477e0eb5dc0da8a5049aba2f6e9e908;hb=4e1cc8e6ddf90e4e2fa5eab27cca4110e4dce1bb;hpb=ca0122d822ea7dd573f05ca4cf43c5d0ff9f4adb diff --git a/mutex.c b/mutex.c index 75809221..e5b045ec 100644 --- a/mutex.c +++ b/mutex.c @@ -22,6 +22,12 @@ void __fio_mutex_remove(struct fio_mutex *mutex) { assert(mutex->magic == FIO_MUTEX_MAGIC); pthread_cond_destroy(&mutex->cond); + + /* + * Ensure any subsequent attempt to grab this mutex will fail + * with an assert, instead of just silently hanging. + */ + memset(mutex, 0, sizeof(*mutex)); } void fio_mutex_remove(struct fio_mutex *mutex)