diff options
author | Karl Williamson <khw@cpan.org> | 2020-11-30 09:46:34 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2020-12-08 06:44:20 -0700 |
commit | d9e22c6a8a05aab7fffdbf810f74ddfcb4efd752 (patch) | |
tree | e07ddc2c28e07f5e4f7b7b100265627111a89e41 /makedef.pl | |
parent | 8609fe004ed37605b00f517feb6e9c8eb127952c (diff) | |
download | perl-d9e22c6a8a05aab7fffdbf810f74ddfcb4efd752.tar.gz |
Refactor locale mutex setup
This was prompted by my realization that even on a locale thread-safe
platform, there are functions we call that may not be thread-safe in
that they return their results in an internal static buffer, which may
be process-wide instead of per-thread. Tomasz Konojacki++ briefly
looked at Windows source code for localeconv() and this indeed did
appear to be the case.
If we thought a platform was thread-safe, no locale mutexes were set up,
and instead the calls in the code to lock were no-oops. This would lead
to potential races, the most likely candidate being localeconv(). None
have been reported, at least as far as we know. Likely that function
isn't called frequently. This would be true on both Posix 2008 and
Windows platforms, except possibly for FreeBSD, which may be the only
platform that we support that has a localeconv_l() function, which is
supposed to be immune from this issue..
The solution adopted here is to test for all the possible functions that
the Perl core uses that may be susceptible to this, and to set up the
mutex if any are found. Thus there won't be no-ops where there should
be a lock.
Diffstat (limited to 'makedef.pl')
-rw-r--r-- | makedef.pl | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/makedef.pl b/makedef.pl index 9af199d9a2..1d1941f589 100644 --- a/makedef.pl +++ b/makedef.pl @@ -455,9 +455,6 @@ unless ($define{'PERL_IMPLICIT_CONTEXT'}) { if ($define{USE_THREAD_SAFE_LOCALE}) { ++$skip{PL_lc_numeric_mutex}; ++$skip{PL_lc_numeric_mutex_depth}; - if (! $define{TS_W32_BROKEN_LOCALECONV}) { - ++$skip{PL_locale_mutex}; - } } unless ($define{'USE_DTRACE'}) { |