From: Bruce Cran Date: Fri, 29 Mar 2013 16:17:25 +0000 (+0000) Subject: Workaround pthreads-win32 pthread_rwlock_init limitation. X-Git-Tag: fio-2.0.15~6 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=09f17d62b3bcade70bca6c8660a6a2cb75ab0ca2;p=fio.git Workaround pthreads-win32 pthread_rwlock_init limitation. On Windows, pthreads-win32 returns EINVAL if you specify an attribute when calling pthread_rwlock_init. Work around this by only specifying the attribute when FIO_HAVE_PSHARED_MUTEX is defined. Signed-off-by: Jens Axboe --- diff --git a/mutex.c b/mutex.c index d1e3ceae..e1fbb607 100644 --- a/mutex.c +++ b/mutex.c @@ -205,9 +205,12 @@ struct fio_rwlock *fio_rwlock_init(void) log_err("pthread_rwlockattr_setpshared: %s\n", strerror(ret)); goto destroy_attr; } -#endif ret = pthread_rwlock_init(&lock->lock, &attr); +#else + ret = pthread_rwlock_init(&lock->lock, NULL); +#endif + if (ret) { log_err("pthread_rwlock_init: %s\n", strerror(ret)); goto destroy_attr;