diff options
author | Karl Williamson <khw@cpan.org> | 2016-04-08 13:46:44 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2016-04-08 13:50:15 -0600 |
commit | fc82b82ef4784a38877f35f56ee16f14934460ce (patch) | |
tree | 98332a6656f519b13fdb622f33701716965de486 /lib | |
parent | bcc9f606509ad2fad50e16f081103451b7dc49e1 (diff) | |
download | perl-fc82b82ef4784a38877f35f56ee16f14934460ce.tar.gz |
Strengthen cautions about locale use with threads
This comes from our increased understanding of their perils, given
ticket #127708
Diffstat (limited to 'lib')
-rw-r--r-- | lib/locale.pm | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/locale.pm b/lib/locale.pm index e2317ca871..02e4bb2434 100644 --- a/lib/locale.pm +++ b/lib/locale.pm @@ -1,6 +1,6 @@ package locale; -our $VERSION = '1.08'; +our $VERSION = '1.09'; use Config; $Carp::Internal{ (__PACKAGE__) } = 1; @@ -9,6 +9,17 @@ $Carp::Internal{ (__PACKAGE__) } = 1; locale - Perl pragma to use or avoid POSIX locales for built-in operations +=head1 WARNING + +DO NOT USE this pragma in scripts that have multiple +L<threads|threads> active. The locale is not local to a single thread. +Another thread may change the locale at any time, which could cause at a +minimum that a given thread is operating in a locale it isn't expecting +to be in. On some platforms, segfaults can also occur. The locale +change need not be explicit; some operations cause perl to change the +locale itself. You are vulnerable simply by having done a C<"use +locale">. + =head1 SYNOPSIS @x = sort @y; # Native-platform/Unicode code point sort order |