summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Hervey <bilboed@bilboed.com>2010-10-08 18:57:12 +0200
committerEdward Hervey <bilboed@bilboed.com>2010-10-08 18:57:12 +0200
commit08fc5862402ab60429a68e7425be52650fae7f56 (patch)
tree9563fa3579b05773e2220855bfafa93100661411
parente7f6d8dff011efb5e69b5db01e3ae3d8fecd6bf9 (diff)
gthread-posix: Use PTHREAD_RWLOCK_PREFER_WRITER_NP if availablerwlock
This is to emulate the same behaviour as the non-native rwlock
-rw-r--r--gthread/gthread-posix.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gthread/gthread-posix.c b/gthread/gthread-posix.c
index 992ecea85..d7e250255 100644
--- a/gthread/gthread-posix.c
+++ b/gthread/gthread-posix.c
@@ -84,7 +84,11 @@ static gboolean posix_check_cmd_prio_warned = FALSE;
#if defined(G_THREADS_IMPL_POSIX)
# define posix_error(what) (what)
# define mutexattr_default NULL
-# define rwlockattr_default NULL
+# if defined(PTHREAD_RWLOCK_PREFER_WRITER_NP)
+# define rwlockattr_default PTHREAD_RWLOCK_PREFER_WRITER_NP
+# else
+# define rwlockattr_default NULL
+# endif
# define condattr_default NULL
#elif defined(G_THREADS_IMPL_DCE)
# define posix_error(what) ((what) == -1 ? errno : 0)