about summary refs log tree commit diff
path: root/nptl
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-09-09 04:59:02 +0000
committerUlrich Drepper <drepper@redhat.com>2004-09-09 04:59:02 +0000
commit31f93b3b72ddcce47d867720f0b53016166dc667 (patch)
tree34a8e1e81e915f02d9c35b50efa867610f350876 /nptl
parent062ad132240ff74929001456bf1c62c1f1f94c86 (diff)
downloadglibc-31f93b3b72ddcce47d867720f0b53016166dc667.tar.gz
glibc-31f93b3b72ddcce47d867720f0b53016166dc667.tar.xz
glibc-31f93b3b72ddcce47d867720f0b53016166dc667.zip
[BZ #375]
Update.
2004-09-08  Ulrich Drepper  <drepper@redhat.com>

	* sysdeps/pthread/pthread.h
	(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
	(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
	(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
	(PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
	[BZ #375]
Diffstat (limited to 'nptl')
-rw-r--r--nptl/ChangeLog9
-rw-r--r--nptl/sysdeps/pthread/pthread.h32
2 files changed, 33 insertions, 8 deletions
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index f382a0080c..ea56746894 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,12 @@
+2004-09-08  Ulrich Drepper  <drepper@redhat.com>
+
+	* sysdeps/pthread/pthread.h
+	(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP): Make safe for C++.
+	(PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP): Likewise.
+	(PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP): Likewise.
+	(PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP): Likewise.
+	[BZ #375]
+
 2004-09-07  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/powerpc/powerpc64/sysdep-cancel.h: Allow
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 1b0463c10c..c4c9ec808c 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -27,6 +27,7 @@
 #include <signal.h>
 #include <bits/pthreadtypes.h>
 #include <bits/setjmp.h>
+#include <bits/wordsize.h>
 
 
 /* Detach state.  */
@@ -63,12 +64,21 @@ enum
 #define PTHREAD_MUTEX_INITIALIZER \
   { }
 #ifdef __USE_GNU
-# define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-  { .__data = { .__kind = PTHREAD_MUTEX_RECURSIVE_NP } }
-# define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-  { .__data = { .__kind = PTHREAD_MUTEX_ERRORCHECK_NP } }
-# define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-  { .__data = { .__kind = PTHREAD_MUTEX_ADAPTIVE_NP } }
+# if __WORDSIZE == 64
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+#  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+#  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+# else
+#  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+#  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+#  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
+  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+# endif
 #endif
 
 
@@ -87,8 +97,14 @@ enum
 #define PTHREAD_RWLOCK_INITIALIZER \
   { }
 #ifdef __USE_GNU
-# define PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP \
-  { .__data = { .__flags = PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP } }
+# 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 } }
+# endif
 #endif