]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* sysdeps/pthread/bits/libc-lock.h (__libc_rwlock_init): Inside of
authorUlrich Drepper <drepper@redhat.com>
Wed, 10 Oct 2007 16:00:14 +0000 (16:00 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 10 Oct 2007 16:00:14 +0000 (16:00 +0000)
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.

localedata/locales/de_DE
nptl/ChangeLog
nptl/sysdeps/pthread/bits/libc-lock.h
nptl/tst-initializers1.c

index a694dc28884ebd8a11fd827ee5a5e3af2d1d6032..1298854b018fb8f1b86ceade83318e3b8314430e 100644 (file)
@@ -76,8 +76,6 @@ END LC_CTYPE
 
 LC_COLLATE
 
-define DIACRIT_FORWARD
-
 % Copy the template from ISO/IEC 14651
 copy "iso14651_t1"
 
index 5d11b6ab7dbbb927f518efb47a3a08b136788af0..b7c03dc3309bdd94cc588ece96fb16b827244043 100644 (file)
@@ -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
index 45eba061330ee499b9aafd94ccd4353678f9ba01..a597f3b5a65c48afb377d613850f5cdfc571466a 100644 (file)
@@ -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)
index 9036e6eac30435b1efcea8abe23929272d9de85b..d30e885e085f5f5d8be0c41ea1fba0a2c914189c 100644 (file)
@@ -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;
 }