summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-05-27 18:06:18 +0000
committerUlrich Drepper <drepper@redhat.com>2007-05-27 18:06:18 +0000
commite59660bc25a272bf2f00f3c37dfa736f3d58845f (patch)
treec209cb5fe9e0581ba5fff57dc038b1b6fb43516d /nptl/sysdeps/pthread/pthread.h
parent546346b6f849fea25265f48c5b9cf536ef1cf4ee (diff)
downloadglibc-e59660bc25a272bf2f00f3c37dfa736f3d58845f.tar.gz
glibc-e59660bc25a272bf2f00f3c37dfa736f3d58845f.tar.xz
glibc-e59660bc25a272bf2f00f3c37dfa736f3d58845f.zip
* init.c: Make it compile with older kernel headers.
	* tst-initializers1.c: Show through exit code which test failed.

	* pthread_rwlock_init.c: Also initialize __shared field.
	* sysdeps/unix/sysv/linux/i386/bits/pthreadtypes.h: Split __flags
	element in rwlock structure into four byte elements.  One of them is
	the new __shared element.
	* sysdeps/unix/sysv/linux/x86_64/bits/pthreadtypes.h [__WORDSIZE=32]:
	Likewise.
	[__WORDSIZE=64]: Renamed __pad1 element int rwlock structire to
	__shared, adjust names of other padding elements.
	* sysdeps/unix/sysv/linux/powerpc/bits/pthreadtypes.h: Likewise.
	* sysdeps/pthread/pthread.h: Adjust rwlock initializers.
	* sysdeps/unix/sysv/linux/lowlevelrwlock.sym: Add PSHARED.
	* sysdeps/unix/sysv/linux/powerpc/lowlevellock.h: Define
	FUTEX_PRIVATE_FLAG.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_rdlock.S: Change main
	futex to use private operations if possible.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedrdlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_timedwrlock.S:
	Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_unlock.S: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/pthread_rwlock_wrlock.S: Likewise.
Diffstat (limited to 'nptl/sysdeps/pthread/pthread.h')
-rw-r--r--nptl/sysdeps/pthread/pthread.h19
1 files changed, 11 insertions, 8 deletions
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 4dc0b2272b..d175f312ee 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -21,6 +21,7 @@
 #define _PTHREAD_H	1
 
 #include <features.h>
+#include <endian.h>
 #include <sched.h>
 #include <time.h>
 
@@ -120,21 +121,23 @@ enum
 };
 
 /* Read-write lock initializers.  */
-# if __WORDSIZE == 64
-#  define PTHREAD_RWLOCK_INITIALIZER \
+# define PTHREAD_RWLOCK_INITIALIZER \
   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }
-# else
-#  define PTHREAD_RWLOCK_INITIALIZER \
-  { { 0, 0, 0, 0, 0, 0, 0, 0 } }
-# endif
 # ifdef __USE_GNU
 #  if __WORDSIZE == 64
 #   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
   { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,					      \
       PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
 #  else
-#   define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-  { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
+#   if __BYTE_ORDER == __LITTLE_ENDIAN
+#    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, \
+      0, 0, 0, 0 } }
+#   else
+#    define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
+  { { 0, 0, 0, 0, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,\
+      0 } }
+#   endif
 #  endif
 # endif
 #endif  /* Unix98 or XOpen2K */