From 06283613f8e6e81053444fea0cfc441db9c776a9 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Fri, 20 Dec 2019 14:40:47 -0700 Subject: [PATCH] POSIX.pod: Update setlocale() docs This should have been updated in 5.28, but was overlooked. --- ext/POSIX/lib/POSIX.pod | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/ext/POSIX/lib/POSIX.pod b/ext/POSIX/lib/POSIX.pod index cab1501..d0b7f5a 100644 --- a/ext/POSIX/lib/POSIX.pod +++ b/ext/POSIX/lib/POSIX.pod @@ -1451,14 +1451,18 @@ see L. =item C -WARNING! Do NOT use this function in a L. The locale -will change in all other threads at the same time, and should your -thread get paused by the operating system, and another started, that -thread will not have the locale it is expecting. On some platforms, -there can be a race leading to segfaults if two threads call this -function nearly simultaneously. - -Modifies and queries the program's underlying locale. Users of this +WARNING! Prior to Perl 5.28 or on a system that does not support +thread-safe locale operations, do NOT use this function in a +L. The locale will change in all other threads at the +same time, and should your thread get paused by the operating system, +and another started, that thread will not have the locale it is +expecting. On some platforms, there can be a race leading to segfaults +if two threads call this function nearly simultaneously. On unthreaded +builds, or on Perl 5.28 and later on thread-safe systems, this warning +does not apply. + +This function +modifies and queries the program's underlying locale. Users of this function should read L, whch provides a comprehensive discussion of Perl locale handling, knowledge of which is necessary to properly use this function. It contains @@ -1466,7 +1470,9 @@ L. The discussion here is merely a summary reference for C. Note that Perl itself is almost entirely unaffected by the locale except within the scope of S>. (Exceptions are listed -in L.) +in L, and +locale-dependent functions within the POSIX module ARE always affected +by the current locale.) The following examples assume -- 1.8.3.1