PATCH: Add __PTHREAD_RWLOCK_INT_FLAGS_SHARED
H.J. Lu
hongjiu.lu@intel.com
Fri May 11 14:37:00 GMT 2012
Hi,
This patch adds __PTHREAD_RWLOCK_INT_FLAGS_SHARED so that x32 can
use the same PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP as
64-bit targets. Tested on Linux/x86-64/x32/ia32. OK to install?
Thanks.
H.J.
---
* sysdeps/pthread/pthread.h (__PTHREAD_RWLOCK_INT_FLAGS_SHARED):
New.
(PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Check
__PTHREAD_RWLOCK_INT_FLAGS_SHARED instead of __WORDSIZE.
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index bd97e85..8f10c87 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -118,11 +118,17 @@ enum
PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
};
+#ifndef __PTHREAD_RWLOCK_INT_FLAGS_SHARED
+# if __WORDSIZE == 64
+# define __PTHREAD_RWLOCK_INT_FLAGS_SHARED 1
+# endif
+#endif
+
/* Read-write lock initializers. */
# define PTHREAD_RWLOCK_INITIALIZER \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
# ifdef __USE_GNU
-# if __WORDSIZE == 64
+# ifdef __PTHREAD_RWLOCK_INT_FLAGS_SHARED
# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
{ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
More information about the Libc-alpha
mailing list