Skip to content

Commit

Permalink
XXX make sure comments get moved appropriately perl.h: Remove now emp…
Browse files Browse the repository at this point in the history
…ty block

Previous commits have left this empty except for comments.
  • Loading branch information
khwilliamson committed May 9, 2021
1 parent 2a5a9a8 commit 564b66c
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions perl.h
Expand Up @@ -6760,40 +6760,6 @@ 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) \
&& defined(USE_LOCALE_THREADS) \
&& ( ! defined(USE_THREAD_SAFE_LOCALE)))

/* 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
* locale-dependent functions in the core isn't thread-safe. The latter
* case is generally because they return a pointer to a static buffer, which
* may be per-process instead of per-thread. There are supposedly
* re-entrant, safe versions for all of them Perl currently uses (which the
* #if above checks for), but most platforms don't have all the needed ones
* available, and the Posix standard doesn't require nl_langinfo_l() to be
* fully thread-safe, so a Configure probe was written. localeconv_l() is
* uncommon, and judging by bug reports on the web, some earlier library
* localeconv_l versions were broken, so perhaps a probe is in order for
* that, but it would be a pain to write.
*
* On non-thread-safe systems, some of the above functions are vulnerable to
* races should another thread get control and change the locale in the
* middle of their execution.
*
* We currently use a single mutex for all these cases. This solves both
* the problem of another thread changing the locale, and the buffer being
* overwritten (the code copies the results to a safe place before releasing
* the mutex). Ideally, for locale thread-safe platforms where the only
* issue is another thread clobbering the function's static buffer, there
* would be a separate mutex for each such buffer. Otherwise, things get
* locked that don't need to. But, it is not expected that any of these
* will be called frequently, and the locked interval should be short, and
* modern platforms will have reentrant versions (which don't lock) for
* almost all of them, so khw thinks a single mutex should suffice. */

#endif

#ifndef LOCALE_LOCK_
# define LOCALE_LOCK_(cond) NOOP
Expand Down

0 comments on commit 564b66c

Please sign in to comment.