summaryrefslogtreecommitdiff
path: root/sv.c
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-03-13 20:51:58 -0700
committerKarl Williamson <khw@cpan.org>2022-09-09 12:26:40 -0600
commit05b43cb096b63fe71b7d2ce2dc00e0f7ee0f2903 (patch)
tree81b7268d6b806b1f7a86906701c5f7a379a3d002 /sv.c
parentda1b79a9e089c13238fc509948c252d2cb15ebde (diff)
downloadperl-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.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/sv.c b/sv.c
index de6dc8070f..172a1faa5e 100644
--- a/sv.c
+++ b/sv.c
@@ -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;