summary refs log tree commit diff
path: root/locale/freelocale.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-03-31 00:38:06 +0000
committerUlrich Drepper <drepper@redhat.com>2008-03-31 00:38:06 +0000
commit9a69db292ac1548647ec6126dfa98a5daa88d239 (patch)
tree506e479204919607cb93da74a3da9f197c67ded0 /locale/freelocale.c
parent2ecc7d93b88b5b9e8ef5833c541d2db1c4608799 (diff)
downloadglibc-9a69db292ac1548647ec6126dfa98a5daa88d239.tar.gz
glibc-9a69db292ac1548647ec6126dfa98a5daa88d239.tar.xz
glibc-9a69db292ac1548647ec6126dfa98a5daa88d239.zip
[BZ #5443]
2008-03-30  Ulrich Drepper  <drepper@redhat.com>
	[BZ #5443]
	* intl/dcigettext.c (__dcigettext): Get reader lock for locale data
	before looking for translation.
	* locale/duplocale.c: Transform __libc_setlocale_lock into rwlock.
	* locale/freelocale.c: Likewise.
	* locale/newlocale.c: Likewise.
	* locale/setlocale.c: Likewise.
	Based partially on a patch by ryo@np.css.fujitsu.com.
Diffstat (limited to 'locale/freelocale.c')
-rw-r--r--locale/freelocale.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/locale/freelocale.c b/locale/freelocale.c
index 7430455d56..97a8ee8a5e 100644
--- a/locale/freelocale.c
+++ b/locale/freelocale.c
@@ -1,5 +1,5 @@
 /* Free data allocated by a call to setlocale_r
-   Copyright (C) 1996, 1997, 2000, 2002, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1996,1997,2000,2002,2005,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
 
@@ -26,7 +26,7 @@
 
 
 /* Lock for protecting global data.  */
-__libc_lock_define (extern , __libc_setlocale_lock attribute_hidden)
+__libc_rwlock_define (extern , __libc_setlocale_lock attribute_hidden)
 
 
 void
@@ -39,7 +39,7 @@ __freelocale (__locale_t dataset)
     return;
 
   /* We modify global data (the usage counts).  */
-  __libc_lock_lock (__libc_setlocale_lock);
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
 
   for (cnt = 0; cnt < __LC_LAST; ++cnt)
     if (cnt != LC_ALL && dataset->__locales[cnt]->usage_count != UNDELETABLE)
@@ -47,7 +47,7 @@ __freelocale (__locale_t dataset)
       _nl_remove_locale (cnt, dataset->__locales[cnt]);
 
   /* It's done.  */
-  __libc_lock_unlock (__libc_setlocale_lock);
+  __libc_rwlock_unlock (__libc_setlocale_lock);
 
   /* Free the locale_t handle itself.  */
   free (dataset);