diff options
author | Ulrich Drepper <drepper@redhat.com> | 2008-03-31 00:38:06 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2008-03-31 00:38:06 +0000 |
commit | 9a69db292ac1548647ec6126dfa98a5daa88d239 (patch) | |
tree | 506e479204919607cb93da74a3da9f197c67ded0 /locale/setlocale.c | |
parent | 2ecc7d93b88b5b9e8ef5833c541d2db1c4608799 (diff) | |
download | glibc-9a69db292ac1548647ec6126dfa98a5daa88d239.zip glibc-9a69db292ac1548647ec6126dfa98a5daa88d239.tar.gz glibc-9a69db292ac1548647ec6126dfa98a5daa88d239.tar.bz2 |
[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/setlocale.c')
-rw-r--r-- | locale/setlocale.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/locale/setlocale.c b/locale/setlocale.c index c1b8c3f..767a5aa 100644 --- a/locale/setlocale.c +++ b/locale/setlocale.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1991, 1992, 1995-2000, 2002, 2003, 2004, 2006 +/* Copyright (C) 1991, 1992, 1995-2000, 2002, 2003, 2004, 2006, 2008 Free Software Foundation, Inc. This file is part of the GNU C Library. @@ -123,7 +123,7 @@ static void (*const _nl_category_postload[]) (void) = /* Lock for protecting global data. */ -__libc_lock_define_initialized (, __libc_setlocale_lock attribute_hidden) +__libc_rwlock_define_initialized (, __libc_setlocale_lock attribute_hidden) /* Defined in loadmsgcat.c. */ extern int _nl_msg_cat_cntr; @@ -314,7 +314,7 @@ setlocale (int category, const char *locale) } /* Protect global data. */ - __libc_lock_lock (__libc_setlocale_lock); + __libc_rwlock_wrlock (__libc_setlocale_lock); /* Load the new data for each category. */ while (category-- > 0) @@ -381,7 +381,7 @@ setlocale (int category, const char *locale) free ((char *) newnames[category]); /* Critical section left. */ - __libc_lock_unlock (__libc_setlocale_lock); + __libc_rwlock_unlock (__libc_setlocale_lock); /* Free the resources (the locale path variable). */ free (locale_path); @@ -394,7 +394,7 @@ setlocale (int category, const char *locale) const char *newname[1] = { locale }; /* Protect global data. */ - __libc_lock_lock (__libc_setlocale_lock); + __libc_rwlock_wrlock (__libc_setlocale_lock); if (CATEGORY_USED (category)) { @@ -446,7 +446,7 @@ setlocale (int category, const char *locale) } /* Critical section left. */ - __libc_lock_unlock (__libc_setlocale_lock); + __libc_rwlock_unlock (__libc_setlocale_lock); /* Free the resources (the locale path variable. */ free (locale_path); |