diff options
author | Karl Williamson <khw@cpan.org> | 2018-02-13 13:12:50 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2018-02-18 15:44:23 -0700 |
commit | 49d7d366441813aa7301b1a437e302372f04f31a (patch) | |
tree | 619c3271adeeab23fe9ea25c9517ebf9807cc1fe /perlvars.h | |
parent | 398eeea9cd1c8a9b95329a3eca8be6a2a5903ac5 (diff) | |
download | perl-49d7d366441813aa7301b1a437e302372f04f31a.tar.gz |
Latch LC_NUMERIC during critical sections
It is possible for operations on threaded perls which don't 'use locale'
to still change the locale. This happens when calling
POSIX::localeconv() and I18N::Langinfo(), and in earlier perls, it can
happen for other operations when perl has been initialized with the
environment causing the various locale categories to not have a uniform
locale.
This commit causes the areas where the locale for this category should
predictably be in one or the other state to be a critical section where
another thread can't interrupt and change it. This is a separate
mutex, so that only these particular operations will be held up.
Diffstat (limited to 'perlvars.h')
-rw-r--r-- | perlvars.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/perlvars.h b/perlvars.h index 708badef07..be67a59988 100644 --- a/perlvars.h +++ b/perlvars.h @@ -100,6 +100,7 @@ PERLVARI(G, mmap_page_size, IV, 0) #if defined(USE_ITHREADS) PERLVAR(G, hints_mutex, perl_mutex) /* Mutex for refcounted he refcounting */ PERLVAR(G, locale_mutex, perl_mutex) /* Mutex for setlocale() changing */ +PERLVAR(G, lc_numeric_mutex, perl_mutex) /* Mutex for switching LC_NUMERIC */ #endif |