summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2022-09-10 13:29:03 -0600
committerKarl Williamson <khw@cpan.org>2022-09-10 13:30:28 -0600
commitdd5ca6941615cc2e8217c6e5619f768c79138e79 (patch)
treec3b4f207502386393e0a287eee607ffd61c89025
parentf363bf1f855ba0bb36562131723d11320368c7c4 (diff)
downloadperl-dd5ca6941615cc2e8217c6e5619f768c79138e79.tar.gz
Revert "perl.h: Move #defining SETLOCALE_LOCK"
This reverts commit d0b8b8e8a48798446382161f988e6081140578d6. I got ahead of myself. This commit was premature
-rw-r--r--perl.h21
1 files changed, 13 insertions, 8 deletions
diff --git a/perl.h b/perl.h
index 95e739060a..bc3ebe206e 100644
--- a/perl.h
+++ b/perl.h
@@ -7117,8 +7117,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
/* By definition, a thread-unsafe locale means we need a critical
* section. */
-# define SETLOCALE_LOCK LOCALE_LOCK_(0)
-# define SETLOCALE_UNLOCK LOCALE_UNLOCK_
+
# ifdef USE_LOCALE_NUMERIC
# define LC_NUMERIC_LOCK(cond_to_panic_if_already_locked) \
LOCALE_LOCK_(cond_to_panic_if_already_locked)
@@ -7157,6 +7156,8 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
* threaded build. */
# define LOCALE_READ_LOCK NOOP
# define LOCALE_READ_UNLOCK NOOP
+# define SETLOCALE_LOCK NOOP
+# define SETLOCALE_UNLOCK NOOP
#else
/* Here, we will need critical sections in locale handling, because one or
@@ -7188,6 +7189,16 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
* modern platforms will have reentrant versions (which don't lock) for
* almost all of them, so khw thinks a single mutex should suffice. */
+# if defined(USE_THREAD_SAFE_LOCALE)
+
+ /* There may be instance core where we this is invoked yet should do
+ * nothing. Rather than have #ifdef's around them, define it here */
+# define SETLOCALE_LOCK NOOP
+# define SETLOCALE_UNLOCK NOOP
+# else
+# define SETLOCALE_LOCK LOCALE_LOCK_(0)
+# define SETLOCALE_UNLOCK LOCALE_UNLOCK_
+# endif
#endif
#ifndef LOCALE_LOCK_
@@ -7217,12 +7228,6 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
#define gwLOCALE_LOCK LOCALE_LOCK_(0)
#define gwLOCALE_UNLOCK LOCALE_UNLOCK_
-/* This was defined above for the case where locales aren't thread safe. */
-#ifndef SETLOCALE_LOCK
-# define SETLOCALE_LOCK NOOP
-# define SETLOCALE_UNLOCK NOOP
-#endif
-
#ifndef LC_NUMERIC_LOCK
# define LC_NUMERIC_LOCK(cond) NOOP
# define LC_NUMERIC_UNLOCK NOOP