$define{USE_REENTRANT_API} = 1;
}
-if ( $define{USE_ITHREADS}
+if ( ($define{USE_ITHREADS} || $define{USE_THREAD_SAFE_LOCALE})
&& $define{HAS_SETLOCALE}
&& ! $define{NO_LOCALE}
&& ! $define{NO_POSIX_2008_LOCALE})
++$skip{$_} foreach qw(
PL_keyword_plugin_mutex
PL_check_mutex
- PL_curlocales
PL_op_mutex
PL_regex_pad
PL_regex_padav
Perl_stashpv_hvname_match
Perl_regdupe_internal
Perl_newPADOP
- PL_C_locale_obj
);
}
+unless ($define{USE_ITHREADS} || $define{USE_THREAD_SAFE_LOCALE})
+{
+ ++$skip{$_} foreach qw(
+ PL_C_locale_obj
+ PL_curlocales
+ );
+}
+
unless ( $define{'HAS_NEWLOCALE'}
&& $define{'HAS_FREELOCALE'}
&& $define{'HAS_USELOCALE'}
# define HAS_POSIX_2008_LOCALE
# endif
-# if defined(USE_ITHREADS) \
+ /* If compiled with
+ * -DUSE_THREAD_SAFE_LOCALE, will do so even
+ * on unthreaded builds */
+# if (defined(USE_ITHREADS) || defined(USE_THREAD_SAFE_LOCALE)) \
&& ( defined(HAS_POSIX_2008_LOCALE) \
|| (defined(WIN32) && defined(_MSC_VER) && _MSC_VER >= 1400)) \
&& ! defined(NO_THREAD_SAFE_LOCALE)
-# define USE_THREAD_SAFE_LOCALE
+# ifndef USE_THREAD_SAFE_LOCALE
+# define USE_THREAD_SAFE_LOCALE
+# endif
# ifdef HAS_POSIX_2008_LOCALE
# define USE_POSIX_2008_LOCALE
# endif
=item *
-XXX
+Normally the thread-safe functions used only on threaded builds.
+It is now possible to force their use on unthreaded builds on systems
+that have them available, by including the
+C<-Accflags='-DUSE_THREAD_SAFE_LOCALE'> option to F<Configure>.
=back
C<${^SAFE_LOCALES}> will be 0 on systems that turn off the thread-safe
operations.
+Normally on unthreaded builds, the traditional C<setlocale()> is used
+and not the thread-safe locale functions. You can force the use of these
+on systems that have them by adding the
+C<-Accflags='-DUSE_THREAD_SAFE_LOCALE'> to F<Configure>.
+
The initial program is started up using the locale specified from the
environment, as currently, described in L</ENVIRONMENT>. All newly
created threads start with C<LC_ALL> set to C<"C">>. Each thread may