summary refs log tree commit diff
path: root/time
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2008-04-11 08:20:04 +0000
committerUlrich Drepper <drepper@redhat.com>2008-04-11 08:20:04 +0000
commit91e32540c463bc9a1158ce8fe668179f84c77226 (patch)
tree15a87453c81dbf29e48315b8870fad8053283d46 /time
parent1db5b6f4f30f856c990fc8990c07b60bf4834930 (diff)
downloadglibc-91e32540c463bc9a1158ce8fe668179f84c77226.tar.gz
glibc-91e32540c463bc9a1158ce8fe668179f84c77226.tar.xz
glibc-91e32540c463bc9a1158ce8fe668179f84c77226.zip
[BZ #5443]
2008-04-11  Jakub Jelinek  <jakub@redhat.com>
	[BZ #5443]
	* time/era.c: Transform __libc_setlocale_lock into rwlock.
	* time/alt_digit.c: Likewise.
	* wcsmbs/wcsmbsload.c: Likewise.
Diffstat (limited to 'time')
-rw-r--r--time/alt_digit.c16
-rw-r--r--time/era.c8
2 files changed, 12 insertions, 12 deletions
diff --git a/time/alt_digit.c b/time/alt_digit.c
index 1a81ba1254..95e4f07c73 100644
--- a/time/alt_digit.c
+++ b/time/alt_digit.c
@@ -1,5 +1,5 @@
 /* Helper functions used by strftime/strptime to handle alternate digits.
-   Copyright (C) 1995-2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
 #include <string.h>
 
 /* Some of the functions here must not be used while setlocale is called.  */
-__libc_lock_define (extern, __libc_setlocale_lock attribute_hidden)
+__libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
 
 #define CURRENT(item) (current->values[_NL_ITEM_INDEX (item)].string)
 #define CURRENT_WSTR(item) \
@@ -77,7 +77,7 @@ _nl_get_alt_digit (unsigned int number, struct locale_data *current)
   if (number >= 100 || CURRENT (ALT_DIGITS)[0] == '\0')
     return NULL;
 
-  __libc_lock_lock (__libc_setlocale_lock);
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
 
   if (current->private.time == NULL
       || ! current->private.time->alt_digits_initialized)
@@ -88,7 +88,7 @@ _nl_get_alt_digit (unsigned int number, struct locale_data *current)
 	    ? current->private.time->alt_digits[number]
 	    : NULL);
 
-  __libc_lock_unlock (__libc_setlocale_lock);
+  __libc_rwlock_unlock (__libc_setlocale_lock);
 
   return result;
 }
@@ -104,7 +104,7 @@ _nl_get_walt_digit (unsigned int number, struct locale_data *current)
   if (number >= 100 || CURRENT_WSTR (_NL_WALT_DIGITS)[0] == L'\0')
     return NULL;
 
-  __libc_lock_lock (__libc_setlocale_lock);
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
 
   if (current->private.time == NULL)
     {
@@ -141,7 +141,7 @@ _nl_get_walt_digit (unsigned int number, struct locale_data *current)
     result = data->walt_digits[number];
 
  out:
-  __libc_lock_unlock (__libc_setlocale_lock);
+  __libc_rwlock_unlock (__libc_setlocale_lock);
 
   return (wchar_t *) result;
 }
@@ -159,7 +159,7 @@ _nl_parse_alt_digit (const char **strp, struct locale_data *current)
   if (CURRENT_WSTR (_NL_WALT_DIGITS)[0] == L'\0')
     return result;
 
-  __libc_lock_lock (__libc_setlocale_lock);
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
 
   if (current->private.time == NULL
       || ! current->private.time->alt_digits_initialized)
@@ -184,7 +184,7 @@ _nl_parse_alt_digit (const char **strp, struct locale_data *current)
 	  }
       }
 
-  __libc_lock_unlock (__libc_setlocale_lock);
+  __libc_rwlock_unlock (__libc_setlocale_lock);
 
   if (result != -1)
     *strp += maxlen;
diff --git a/time/era.c b/time/era.c
index a8d2237338..a6f4a4cb07 100644
--- a/time/era.c
+++ b/time/era.c
@@ -1,5 +1,5 @@
 /* Helper functions used by strftime/strptime to handle locale-specific "eras".
-   Copyright (C) 1995-2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1995-2002, 2008 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
    The GNU C Library is free software; you can redistribute it and/or
@@ -24,7 +24,7 @@
 #include <string.h>
 
 /* Some of the functions here must not be used while setlocale is called.  */
-__libc_lock_define (extern, __libc_setlocale_lock attribute_hidden)
+__libc_rwlock_define (extern, __libc_setlocale_lock attribute_hidden)
 
 #define CURRENT(item)		(current->values[_NL_ITEM_INDEX (item)].string)
 #define CURRENT_WORD(item)	(current->values[_NL_ITEM_INDEX (item)].word)
@@ -45,7 +45,7 @@ _nl_init_era_entries (struct locale_data *current)
   if (CURRENT_WORD (_NL_TIME_ERA_NUM_ENTRIES) == 0)
     return;
 
-  __libc_lock_lock (__libc_setlocale_lock);
+  __libc_rwlock_wrlock (__libc_setlocale_lock);
 
   if (current->private.time == NULL)
     {
@@ -135,7 +135,7 @@ _nl_init_era_entries (struct locale_data *current)
     }
 
  out:
-  __libc_lock_unlock (__libc_setlocale_lock);
+  __libc_rwlock_unlock (__libc_setlocale_lock);
 }
 
 struct era_entry *