diff options
author | Bruce Cran <bruce@cran.org.uk> | 2013-03-29 16:17:25 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2013-03-29 10:38:08 -0600 |
commit | 09f17d62b3bcade70bca6c8660a6a2cb75ab0ca2 (patch) | |
tree | 11bd889b2f08b42ce1a8c06a3207d780adbd9bf3 /mutex.c | |
parent | cdb57fe2e6ab3418e0e137282be46201b1f5acc0 (diff) | |
download | fio-09f17d62b3bcade70bca6c8660a6a2cb75ab0ca2.tar.gz |
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 <axboe@kernel.dk>
Diffstat (limited to 'mutex.c')
-rw-r--r-- | mutex.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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; |