Message ID | 20161228222705.16212-1-aserdean@cloudbasesolutions.com |
---|---|
State | Accepted |
Headers | show |
diff --git a/lib/ovs-thread.c b/lib/ovs-thread.c index 058c434..55c1990 100644 --- a/lib/ovs-thread.c +++ b/lib/ovs-thread.c @@ -240,7 +240,13 @@ ovs_rwlock_init(const struct ovs_rwlock *l_) xpthread_rwlockattr_setkind_np( &attr, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP); #endif +#ifdef _WIN32 + /* XXX: The version of pthreads until 2.9.1 and including do not support + * pthread_rwlock_init with an initialized attribute */ + error = pthread_rwlock_init(&l->lock, NULL); +#else error = pthread_rwlock_init(&l->lock, &attr); +#endif if (OVS_UNLIKELY(error)) { ovs_abort(error, "pthread_rwlock_init failed"); }