about summary refs log tree commit diff
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2007-10-10 16:00:14 +0000
committerUlrich Drepper <drepper@redhat.com>2007-10-10 16:00:14 +0000
commit59d430c6809871b357f2e9e677ef7fdfc03fbf62 (patch)
tree5351e0a72e1895f59b4e4f553527dc80ab8cdac0
parent5a01ab7b838c967ba38720136a71d8b89d5b79ce (diff)
downloadglibc-59d430c6809871b357f2e9e677ef7fdfc03fbf62.tar.gz
glibc-59d430c6809871b357f2e9e677ef7fdfc03fbf62.tar.xz
glibc-59d430c6809871b357f2e9e677ef7fdfc03fbf62.zip
* sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
	libc.so just clear NAME.
	(__libc_rwlock_fini): Nop inside of libc.so.
	* tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
	all zeros.
-rw-r--r--localedata/locales/de_DE2
-rw-r--r--nptl/ChangeLog8
-rw-r--r--nptl/sysdeps/pthread/bits/libc-lock.h15
-rw-r--r--nptl/tst-initializers1.c7
4 files changed, 28 insertions, 4 deletions
diff --git a/localedata/locales/de_DE b/localedata/locales/de_DE
index a694dc2888..1298854b01 100644
--- a/localedata/locales/de_DE
+++ b/localedata/locales/de_DE
@@ -76,8 +76,6 @@ END LC_CTYPE
 
 LC_COLLATE
 
-define DIACRIT_FORWARD
-
 % Copy the template from ISO/IEC 14651
 copy "iso14651_t1"
 
diff --git a/nptl/ChangeLog b/nptl/ChangeLog
index 5d11b6ab7d..b7c03dc330 100644
--- a/nptl/ChangeLog
+++ b/nptl/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-10  Jakub Jelinek  <jakub@redhat.com>
+
+	* sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
+	libc.so just clear NAME.
+	(__libc_rwlock_fini): Nop inside of libc.so.
+	* tst-initializers1.c (main): Test if PTHREAD_RWLOCK_INITIALIZER is
+	all zeros.
+
 2007-09-02  Ulrich Drepper  <drepper@redhat.com>
 
 	* sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S
diff --git a/nptl/sysdeps/pthread/bits/libc-lock.h b/nptl/sysdeps/pthread/bits/libc-lock.h
index 45eba06133..a597f3b5a6 100644
--- a/nptl/sysdeps/pthread/bits/libc-lock.h
+++ b/nptl/sysdeps/pthread/bits/libc-lock.h
@@ -172,8 +172,15 @@ typedef pthread_key_t __libc_key_t;
 # define __libc_lock_init(NAME) \
   __libc_maybe_call (__pthread_mutex_init, (&(NAME), NULL), 0)
 #endif
-#define __libc_rwlock_init(NAME) \
+#if defined SHARED && !defined NOT_IN_libc
+/* ((NAME) = (__libc_rwlock_t) PTHREAD_RWLOCK_INITIALIZER, 0) is
+   inefficient.  */
+# define __libc_rwlock_init(NAME) \
+  (__builtin_memset (&(NAME), '\0', sizeof (NAME)), 0)
+#else
+# define __libc_rwlock_init(NAME) \
   __libc_maybe_call (__pthread_rwlock_init, (&(NAME), NULL), 0)
+#endif
 
 /* Same as last but this time we initialize a recursive mutex.  */
 #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
@@ -214,8 +221,12 @@ typedef pthread_key_t __libc_key_t;
 # define __libc_lock_fini(NAME) \
   __libc_maybe_call (__pthread_mutex_destroy, (&(NAME)), 0)
 #endif
-#define __libc_rwlock_fini(NAME) \
+#if defined SHARED && !defined NOT_IN_libc
+# define __libc_rwlock_fini(NAME) ((void) 0)
+#else
+# define __libc_rwlock_fini(NAME) \
   __libc_maybe_call (__pthread_rwlock_destroy, (&(NAME)), 0)
+#endif
 
 /* Finalize recursive named lock.  */
 #if defined _LIBC && (!defined NOT_IN_libc || defined IS_IN_libpthread)
diff --git a/nptl/tst-initializers1.c b/nptl/tst-initializers1.c
index 9036e6eac3..d30e885e08 100644
--- a/nptl/tst-initializers1.c
+++ b/nptl/tst-initializers1.c
@@ -47,5 +47,12 @@ main (void)
   if (rwl_writer.__data.__flags
       != PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP)
     return 6;
+  /* <bits/libc-lock.h> __libc_rwlock_init definition for libc.so
+     relies on PTHREAD_RWLOCK_INITIALIZER being all zeros.  If
+     that ever changes, <bits/libc-lock.h> needs updating.  */
+  size_t i;
+  for (i = 0; i < sizeof (rwl_normal); i++)
+    if (((char *) &rwl_normal)[i] != '\0')
+      return 7;
   return 0;
 }