Commit 098735fed6 for perl
commit 098735fed6bf5f779f5900473a32a8fce21435cd
Author: Karl Williamson <khw@cpan.org>
Date: Sun Sep 20 20:27:37 2026 -0600
Revert "Temporarily enable thread-safe locale emulation"
This reverts commit 5c89d29f2741502a089e1627d9f70450acb84a9c.
Fixes #24844
lib/locale_threads.t will not hang forever, as it sets an alarm to
prevent that. The alarm is currently at 10 minutes; but could be
lessened.
Except for rebasing, this branch has been smoke-me'd without a problem
showing up. Of course no one would notice the slowdown on those. We do
not have a *BSD CI, but I had checked the Darwin one to see if the
testing there took appreciably longer, and I didn't think it did.
The branch has been smoke-me'd multiple times before with minor changes
between them.
I think the eventual solution is to cut down the number of threads
and/or iterations in the test to an acceptable wall clock time when
thread-safe locales are emulated.
To get a feel for those numbers, I logged on to the FreeBSD machine I
have access to. It is running 14.4-RELEASE-p3. And I now consistently
get an assertion failure in running miniperl to finish the build of
blead. This is a surprise, since the branch has had no problems in
recent smoke-me builds on FreeBSD. I will investigate.
I think that here might be a good place to take a swipe at those OS
vendors that have been lying to us for years that they support POSIX
2008 thread-safe locales. Our test suite passes on those only because
we skip tests we know would fail. locale_threads.t doesn't execute on
those boxes, except long enough to realize it would fail. So of course
it would suddenly take up time when the box gets a thread-safe mode.
And the test is designed to severely test claimed safety. Its slowness
doesn't indicate that a typical work load would be significantly
affected by the emulation. And if these OS'es performed as advertised,
the emulation would not kick in, and locale_threads.t would finish in an
acceptable time. If you are reading this, and have an "in" with the
developer of any of these OS'es, please apprise them that this is more
serious than they appear to think.
Solaris appears to have full thread-safe locale handling; and cygwin
shortly will. Perl works around a bug in glibc on Linux, so they can be
thread-safe, but the workaround slows things down. Windows has had
thread-safe locales for 20 years, disregarding some bugs that have
gotten fixed, but the difference in how they store text internally has
led to a slow interface with us, as noticed in #21611.
diff --git a/embed.h b/embed.h
index 8c9bcacc11..81798b9f46 100644
--- a/embed.h
+++ b/embed.h
@@ -31,7 +31,6 @@
# undef CC_MAGICAL_
# undef CC_UNDERSCORE_
# undef do_aexec
-# undef EMULATE_THREAD_SAFE_LOCALES
# undef F_atan2_amg
# undef F_cos_amg
# undef F_exp_amg
diff --git a/perl.h b/perl.h
index 4da0f0051b..01729fc27f 100644
--- a/perl.h
+++ b/perl.h
@@ -1543,11 +1543,6 @@ typedef enum {
# if defined(USE_POSIX_2008_LOCALE) \
|| (defined(WIN32) && (defined(_MSC_VER) || (defined(_UCRT))))
# define USE_THREAD_SAFE_LOCALE
-# endif
-
- /* Temporary during 5.45 development to find any bugs */
-# if ! defined(USE_THREAD_SAFE_LOCALE) && ! defined(NO_EMULATE_THREAD_SAFE_LOCALES)
-# define EMULATE_THREAD_SAFE_LOCALES
# endif
# endif
@@ -5785,9 +5780,6 @@ EXTERN_C char **environ; /* environment variables supplied via exec */
#define PERL_API_VERSION_STRING STRINGIFY(PERL_API_REVISION) "." \
STRINGIFY(PERL_API_VERSION) "." \
STRINGIFY(PERL_API_SUBVERSION)
-#if PERL_VERSION_GE(5,45,9)
-# error Revert the commit that created this line
-#endif
START_EXTERN_C
diff --git a/pod/perldelta.pod b/pod/perldelta.pod
index a1aba4df14..1dc7545a5f 100644
--- a/pod/perldelta.pod
+++ b/pod/perldelta.pod
@@ -65,11 +65,6 @@ highlighting it here as well because it increases the portability
possibilities of your locale-aware code on multi-threaded builds of
perl.
-To find any problems with this capability, during the 5.45 development
-cycle it is currently turned on by default on threaded perls, just on
-systems without locale thread-safety. See L</Internal Changes> for how
-to turn it off.
-
=head1 Security
XXX Any security-related notices go here. In particular, any security
@@ -460,19 +455,17 @@ into two or more adjacent TRIE nodes might now get compiled into a single
=item *
-Threads are Configured to have locale thread-safety
+Threads may be Configured to have locale thread-safety
The Perl interpreter may now be Configured to emulate thread-safety in
-locale handling on systems that lack it. This feature is on by default
-during a portion of the 5.45 development cycle, so as to test it in the
-field, but the intention is to make it opt-in for the official 5.46
-release. To turn it off, pass this to F<Configure>:
+locale handling on systems that lack it. To do this, pass this to
+F<Configure>:
- -Accflags=-DNO_EMULATE_THREAD_SAFE_LOCALES
+ -Accflags=-DEMULATE_THREAD_SAFE_LOCALES
-The feature is never turned on for builds that don't have threads, and on
-platforms where perl believes that the locale handling is natively
-thread-safe.
+This option will be ignored on builds that don't have threads, and on
+platforms where perl believes that the locale handling is thread-safe
+natively.
See L<perllocale/Multi-threaded operation>.
diff --git a/pod/perllocale.pod b/pod/perllocale.pod
index 2b55742621..4e324291f4 100644
--- a/pod/perllocale.pod
+++ b/pod/perllocale.pod
@@ -542,14 +542,7 @@ Perl avoids their use.
However, beginning in Perl 5.46, Perl may be Configured to emulate
thread-safe operations on any system lacking native thread-safe locales.
This will decrease performance, so you may want to experiment if the
-amount of that decrease is acceptable for your needs. During a portion
-of the 5.45 development cycle, the feature is by default enabled so as
-to actually field test it. To turn it off, add to the Configure call
-the option
-
- -Accflags=-DNO_EMULATE_THREAD_SAFE_LOCALES
-
-To enable this feature on Perl versions where the default is not enabled,
+amount of that decrease is acceptable for your needs. To enable this,
add to the Configure call the option
-Accflags=-DEMULATE_THREAD_SAFE_LOCALES