From 09f17d62b3bcade70bca6c8660a6a2cb75ab0ca2 Mon Sep 17 00:00:00 2001 From: Bruce Cran Date: Fri, 29 Mar 2013 16:17:25 +0000 Subject: [PATCH] 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 --- mutex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; -- 2.25.1