diff options
Diffstat (limited to 'src/locale/newlocale.c')
-rw-r--r-- | src/locale/newlocale.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c index d20a8489..8eee2e10 100644 --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -2,6 +2,7 @@ #include <string.h> #include <pthread.h> #include "locale_impl.h" +#include "lock.h" static pthread_once_t default_locale_once; static struct __locale_struct default_locale, default_ctype_locale; @@ -19,7 +20,7 @@ int __loc_is_allocated(locale_t loc) && loc != &default_locale && loc != &default_ctype_locale; } -locale_t __newlocale(int mask, const char *name, locale_t loc) +static locale_t do_newlocale(int mask, const char *name, locale_t loc) { struct __locale_struct tmp; @@ -55,4 +56,12 @@ locale_t __newlocale(int mask, const char *name, locale_t loc) return loc; } +locale_t __newlocale(int mask, const char *name, locale_t loc) +{ + LOCK(__locale_lock); + loc = do_newlocale(mask, name, loc); + UNLOCK(__locale_lock); + return loc; +} + weak_alias(__newlocale, newlocale); |