about summary refs log tree commit diff
path: root/locale/duplocale.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/duplocale.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/duplocale.c')
-rw-r--r--locale/duplocale.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/locale/duplocale.c b/locale/duplocale.c
index 0cec09f63a..61782590d7 100644
--- a/locale/duplocale.c
+++ b/locale/duplocale.c
@@ -1,5 +1,5 @@
 /* Duplicate handle for selection of locales.
-   Copyright (C) 1997, 2000, 2001, 2002, 2005 Free Software Foundation, Inc.
+   Copyright (C) 1997,2000,2001,2002,2005,2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@cygnus.com>, 1997.
 
@@ -27,7 +27,7 @@
 
 
 /* Lock for protecting global data.  */
-__libc_lock_define (extern , __libc_setlocale_lock attribute_hidden)
+__libc_rwlock_define (extern , __libc_setlocale_lock attribute_hidden)
 
 
 __locale_t
@@ -54,7 +54,7 @@ __duplocale (__locale_t dataset)
       char *namep = (char *) (result + 1);
 
       /* 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)
@@ -78,7 +78,7 @@ __duplocale (__locale_t dataset)
       result->__ctype_toupper = dataset->__ctype_toupper;
 
       /* It's done.  */
-      __libc_lock_unlock (__libc_setlocale_lock);
+      __libc_rwlock_unlock (__libc_setlocale_lock);
     }
 
   return result;