summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2021-03-13 20:17:29 -0700
committerKarl Williamson <khw@cpan.org>2022-09-21 14:34:41 -0600
commit2b85ca2c27f8299bfae0ef634ee0590505f5c01c (patch)
treea8edc09f405600a67354d8a5a82d64024f95a7d9 /perl.h
parent1118ec15947427988784e2ab16171203db9b9d3f (diff)
downloadperl-2b85ca2c27f8299bfae0ef634ee0590505f5c01c.tar.gz
perl.h: Move #defining SETLOCALE_LOCK
This simplifies slightly, and will allow further simplification
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h21
1 files changed, 8 insertions, 13 deletions
diff --git a/perl.h b/perl.h
index 68349e6c01..3c7513e6a5 100644
--- a/perl.h
+++ b/perl.h
@@ -7117,7 +7117,8 @@ 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)
@@ -7156,8 +7157,6 @@ 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
@@ -7189,16 +7188,6 @@ 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
/* There are some locale-related functions which may need locking only because
@@ -7241,6 +7230,12 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define POSIX_SETLOCALE_UNLOCK gwLOCALE_UNLOCK
#endif
+/* 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