git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 4a02af8) | patch
Provide thread-safe pg_localeconv_r().
2025年3月27日 06:52:22 +0000 (07:52 +0100)
2025年3月27日 09:54:28 +0000 (10:54 +0100)
commit b98be8a2a2a6196dc24631dfe4d8785b86800d23
Provide thread-safe pg_localeconv_r().

This involves four different implementation strategies:

1. For Windows, we now require _configthreadlocale() to be available
and work (commit f1da075d9a0), and the documentation says that the
object returned by localeconv() is in thread-local memory.

2. For glibc, we translate to nl_langinfo_l() calls, because it
offers the same information that way as an extension, and that API is
thread-safe.

3. For macOS/*BSD, use localeconv_l(), which is thread-safe.

4. For everything else, use uselocale() to set the locale for the
thread, and use a big ugly lock to defend against the returned object
being concurrently clobbered. In practice this currently means only
Solaris.

The new call is used in pg_locale.c, replacing calls to setlocale() and
localeconv().

Author: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://postgr.es/m/CA%2BhUKGJqVe0%2BPv9dvC9dSums_PXxGo9SWcxYAMBguWJUGbWz-A%40mail.gmail.com
configure diff | blob | blame | history
configure.ac diff | blob | blame | history
meson.build diff | blob | blame | history
src/backend/utils/adt/pg_locale.c diff | blob | blame | history
src/include/pg_config.h.in diff | blob | blame | history
src/include/port.h diff | blob | blame | history
src/port/Makefile diff | blob | blame | history
src/port/meson.build diff | blob | blame | history
src/port/pg_localeconv_r.c [new file with mode: 0644] blob
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /