Skip to content

Commit

Permalink
perl.h: Remove NL_LANGINFO_LOCK
Browse files Browse the repository at this point in the history
This is needed in precisely one place in the code, so move it to there.
  • Loading branch information
khwilliamson committed May 6, 2021
1 parent ab58619 commit 668f9ea
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
4 changes: 2 additions & 2 deletions locale.c
Expand Up @@ -3857,9 +3857,9 @@ S_my_langinfo_i(pTHX_
orig_switched_locale = toggle_locale_i(cat_index, locale);
}

NL_LANGINFO_LOCK;
gwLOCALE_LOCK;
retval = save_to_buffer(nl_langinfo(item), retbufp, retbuf_sizep);
NL_LANGINFO_UNLOCK;
gwLOCALE_UNLOCK;

restore_toggled_locale_i(cat_index, orig_switched_locale);

Expand Down
11 changes: 1 addition & 10 deletions perl.h
Expand Up @@ -6759,9 +6759,7 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
&& ( ! defined(USE_THREAD_SAFE_LOCALE) \
|| ( defined(HAS_LOCALECONV) \
&& ( ! defined(HAS_LOCALECONV_L) \
|| defined(TS_W32_BROKEN_LOCALECONV))) \
|| ( defined(HAS_NL_LANGINFO) \
&& ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L))))
|| defined(TS_W32_BROKEN_LOCALECONV)))))

/* 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
Expand All @@ -6770,8 +6768,6 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define LOCALECONV_UNLOCK NOOP
# define LOCALE_READ_LOCK NOOP
# define LOCALE_READ_UNLOCK NOOP
# define NL_LANGINFO_LOCK NOOP
# define NL_LANGINFO_UNLOCK NOOP
# define SETLOCALE_LOCK NOOP
# define SETLOCALE_UNLOCK NOOP
#else
Expand Down Expand Up @@ -6815,11 +6811,6 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
# define LOCALECONV_LOCK LOCALE_LOCK_(0)
# define LOCALECONV_UNLOCK LOCALE_UNLOCK_
# endif
# if defined(HAS_NL_LANGINFO) && ( ! defined(HAS_THREAD_SAFE_NL_LANGINFO_L) \
|| ! defined(USE_POSIX_2008_LOCALE))
# define NL_LANGINFO_LOCK LOCALE_LOCK_(0)
# define NL_LANGINFO_UNLOCK LOCALE_UNLOCK_
# endif
# if defined(USE_THREAD_SAFE_LOCALE)

/* There may be instance core where we this is invoked yet should do
Expand Down

0 comments on commit 668f9ea

Please sign in to comment.