Skip to content

Commit

Permalink
Revert "start of runtime configthread detection"
Browse files Browse the repository at this point in the history
This reverts commit 196d220949d555ece9b18eb478d5f4ef0f5c99c5.
  • Loading branch information
khwilliamson committed Feb 2, 2023
1 parent 71465e9 commit a87c65b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
15 changes: 5 additions & 10 deletions locale.c
Expand Up @@ -7569,19 +7569,14 @@ Perl_thread_locale_init(pTHX)

uselocale(PL_C_locale_obj);

# else
# if defined(WIN32)
# elif defined(WIN32)

/* On Windows, make sure new thread has per-thread locales enabled, if
* available */
if (PL_has_working_configthread_locale) {
if (_configthreadlocale(_ENABLE_PER_THREAD_LOCALE) == -1) {
locale_panic_("_configthreadlocale returned an error");
}
void_setlocale_c(LC_ALL, "C");
/* On Windows, make sure new thread has per-thread locales enabled */
if (_configthreadlocale(_ENABLE_PER_THREAD_LOCALE) == -1) {
locale_panic_("_configthreadlocale returned an error");
}
void_setlocale_c(LC_ALL, "C");

# endif
# endif
#endif

Expand Down
6 changes: 2 additions & 4 deletions perl.h
Expand Up @@ -7281,14 +7281,12 @@ the plain locale pragma without a parameter (S<C<use locale>>) is in effect.
#if defined(WIN32) && defined(USE_THREAD_SAFE_LOCALE)
# define POSIX_SETLOCALE_LOCK \
STMT_START { \
if ( ! PL_has_working_configthreadlocale \
|| configthreadlocale(0) == _DISABLE_PER_THREAD_LOCALE) \
if (_configthreadlocale(0) == _DISABLE_PER_THREAD_LOCALE) \
gwLOCALE_LOCK; \
} STMT_END
# define POSIX_SETLOCALE_UNLOCK \
STMT_START { \
if ( ! PL_has_working_configthreadlocale \
|| configthreadlocale(0) == _DISABLE_PER_THREAD_LOCALE) \
if (_configthreadlocale(0) == _DISABLE_PER_THREAD_LOCALE) \
gwLOCALE_UNLOCK; \
} STMT_END
#else
Expand Down

0 comments on commit a87c65b

Please sign in to comment.