From 9a69db292ac1548647ec6126dfa98a5daa88d239 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 31 Mar 2008 00:38:06 +0000 Subject: [BZ #5443] 2008-03-30 Ulrich Drepper [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. --- locale/duplocale.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'locale/duplocale.c') 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 , 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; -- cgit v1.2.3-65-gdbad