summary refs log tree commit diff
path: root/nptl/sysdeps/pthread/pthread.h
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2005-07-11 16:41:29 +0000
committerUlrich Drepper <drepper@redhat.com>2005-07-11 16:41:29 +0000
commit3fd1bc67788c74950f994741142880d458dd6251 (patch)
treec69b0920dad15c8aebbd0fdc0411efd4ee256bba /nptl/sysdeps/pthread/pthread.h
parent553185e2b0be6f37fef5ffed4ce8aba2ceaf1f29 (diff)
downloadglibc-3fd1bc67788c74950f994741142880d458dd6251.tar.gz
glibc-3fd1bc67788c74950f994741142880d458dd6251.tar.xz
glibc-3fd1bc67788c74950f994741142880d458dd6251.zip
* sysdeps/pthread/pthread.h (PTHREAD_MUTEX_INITIALIZER,
	PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP,
	PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP,
	PTHREAD_MUTEX_ADAPTIVE_NP, PTHREAD_RWLOCK_INITIALIZER,
	PTHREAD_RWLOCK_WRITER_NONRECURSIVE_INITIALIZER_NP,
	PTHREAD_COND_INITIALIZER): Supply zeros for all fields
	in the structure.
	* Makefile (tests): Add tst-initializers1.
	(CFLAGS-tst-initializers1.c): Set.
	* tst-initializers1.c: New test.

2005-07-11  Jakub Jelinek  <jakub@redhat.com>
Diffstat (limited to 'nptl/sysdeps/pthread/pthread.h')
-rw-r--r--nptl/sysdeps/pthread/pthread.h27
1 files changed, 16 insertions, 11 deletions
diff --git a/nptl/sysdeps/pthread/pthread.h b/nptl/sysdeps/pthread/pthread.h
index 05f3b31fb5..92e66f7c72 100644
--- a/nptl/sysdeps/pthread/pthread.h
+++ b/nptl/sysdeps/pthread/pthread.h
@@ -62,22 +62,22 @@ enum
 
 /* Mutex initializers.  */
 #define PTHREAD_MUTEX_INITIALIZER \
-  { { 0, } }
+  { { 0, 0, 0, 0, 0, 0 } }
 #ifdef __USE_GNU
 # if __WORDSIZE == 64
 #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0 } }
 #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0 } }
 #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+  { { 0, 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0 } }
 # else
 #  define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, 0 } }
 #  define PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_ERRORCHECK_NP, 0, 0 } }
 #  define PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP \
-  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP } }
+  { { 0, 0, 0, PTHREAD_MUTEX_ADAPTIVE_NP, 0, 0 } }
 # endif
 #endif
 
@@ -93,8 +93,13 @@ enum
 };
 
 /* Read-write lock initializers.  */
-# define PTHREAD_RWLOCK_INITIALIZER \
-  { { 0, } }
+# if __WORDSIZE == 64
+#  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 \
@@ -102,7 +107,7 @@ enum
       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, 0, 0, 0, 0, 0, PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP, 0 } }
 #  endif
 # endif
 #endif  /* Unix98 or XOpen2K */
@@ -140,7 +145,7 @@ enum
 
 
 /* Conditional variable handling.  */
-#define PTHREAD_COND_INITIALIZER { { 0, } }
+#define PTHREAD_COND_INITIALIZER { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } }
 
 
 /* Cleanup buffers */