From 36246b347cd135399bc79f9b6617d9a120c00a0d Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Wed, 9 Dec 2020 17:01:57 -0500 Subject: drop use of pthread_once in newlocale in general, pthread_once is not compatible with MT-fork constraints (commit 167390f05564e0a4d3fcb4329377fd7743267560). here it actually no longer matters, because it's now called with a lock held, but since the lock is held it's pointless to use pthread_once. --- src/locale/newlocale.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c index 8eee2e10..12ae87d6 100644 --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -4,16 +4,9 @@ #include "locale_impl.h" #include "lock.h" -static pthread_once_t default_locale_once; +static int default_locale_init_done; static struct __locale_struct default_locale, default_ctype_locale; -static void default_locale_init(void) -{ - for (int i=0; i