This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl.h: Move LOCALE_READ_LOCK #definition
authorKarl Williamson <khw@cpan.org>
Mon, 8 Mar 2021 12:46:25 +0000 (05:46 -0700)
committerKarl Williamson <khw@cpan.org>
Wed, 21 Sep 2022 20:34:41 +0000 (14:34 -0600)
To enable future simplifications

perl.h

diff --git a/perl.h b/perl.h
index 3c7513e..bca762f 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -7148,15 +7148,9 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
                                     MUTEX_DESTROY(&PL_locale_mutex);        \
                                 } STMT_END
 #endif
-#if ! (   defined(USE_LOCALE)                                               \
+#if ! (   defined(USE_LOCALE)                                                 \
        &&    defined(USE_LOCALE_THREADS)                                    \
        && (  ! defined(USE_THREAD_SAFE_LOCALE)))
-
-/* The whole expression just above was complemented, so here we have no need
- * for thread synchronization, most likely it would be that this isn't a
- * threaded build. */
-#  define LOCALE_READ_LOCK          NOOP
-#  define LOCALE_READ_UNLOCK        NOOP
 #else
 
    /* Here, we will need critical sections in locale handling, because one or
@@ -7236,6 +7230,11 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
 #  define SETLOCALE_UNLOCK              NOOP
 #endif
 
+/* Currently, the read lock is an exclusive lock */
+#define LOCALE_READ_LOCK                SETLOCALE_LOCK
+#define LOCALE_READ_UNLOCK              SETLOCALE_UNLOCK
+
+
 #ifndef LC_NUMERIC_LOCK
 #  define LC_NUMERIC_LOCK(cond)   NOOP
 #  define LC_NUMERIC_UNLOCK       NOOP