diff options
author | Karl Williamson <khw@cpan.org> | 2021-03-13 20:51:58 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2022-09-09 12:26:40 -0600 |
commit | 05b43cb096b63fe71b7d2ce2dc00e0f7ee0f2903 (patch) | |
tree | 81b7268d6b806b1f7a86906701c5f7a379a3d002 /sv.c | |
parent | da1b79a9e089c13238fc509948c252d2cb15ebde (diff) | |
download | perl-05b43cb096b63fe71b7d2ce2dc00e0f7ee0f2903.tar.gz |
Use general locale mutex for numeric operations
This commit removes the separate mutex for locking locale-related
numeric operations on threaded perls; instead using the general locale
one. The previous commit made that a general semaphore, so now suitable
for use for this purpose as well.
This means that the locale can be locked for the duration of some
sprintf operations, longer than before this commit. But on most modern
platforms, thread-safe locales cause this lock to expand just to a
no-op; so there is no effect on these. And on the impacted platforms,
one is not supposed to be using locales and threads in combination, as
races can occur. This lock is used on those perls to keep Perl's
manipulation of LC_NUMERIC thread-safe. And for those there is also no
effect, as they already lock around those sprintf's.
Diffstat (limited to 'sv.c')
-rw-r--r-- | sv.c | 3 |
1 files changed, 0 insertions, 3 deletions
@@ -15605,9 +15605,6 @@ perl_clone_using(PerlInterpreter *proto_perl, UV flags, assert(PL_locale_mutex_depth <= 0); PL_locale_mutex_depth = 0; #endif -#if defined(USE_ITHREADS) && ! defined(USE_THREAD_SAFE_LOCALE) - PL_lc_numeric_mutex_depth = 0; -#endif /* Unicode features (see perlrun/-C) */ PL_unicode = proto_perl->Iunicode; |