Skip to content

Commit

Permalink
perl.h: Move LOCALE_READ_LOCK #definition
Browse files Browse the repository at this point in the history
To enable future simplifications
  • Loading branch information
khwilliamson committed May 5, 2021
1 parent c78576c commit 527bfc5
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions perl.h
Expand Up @@ -6755,17 +6755,10 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
LOCALE_TERM_POSIX_2008_; \
} 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
* more of the above conditions are true. This could be because the
* platform doesn't have thread-safe locales, or that at least one of the
Expand Down Expand Up @@ -6845,6 +6838,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
Expand Down

0 comments on commit 527bfc5

Please sign in to comment.