postgresql/src/interfaces/ecpg/ecpglib
Tom Lane a584d03ced Avoid concurrent calls to bindtextdomain().
We previously supposed that it was okay for different threads to
call bindtextdomain() concurrently (cf. commit 1f655fdc3).
It now emerges that there's at least one gettext implementation
in which that triggers an abort() crash, so let's stop doing that.
Add mutexes guarding libpq's and ecpglib's calls, which are the
only ones that need worry about multithreaded callers.

Note: in libpq, we could perhaps have piggybacked on
default_threadlock() to avoid defining a new mutex variable.
I judge that not terribly safe though, since libpq_gettext could
be called from code that is holding the default mutex.  If that
were the first such call in the process, it'd fail.  An extra
mutex is cheap insurance against unforeseen interactions.

Per bug #18312 from Christian Maurer.  Back-patch to all
supported versions.

Discussion: https://postgr.es/m/18312-bbbabc8113592b78@postgresql.org
Discussion: https://postgr.es/m/264860.1707163416@sss.pgh.pa.us
2024-02-09 11:21:08 -05:00
..
po Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore Build src/common files as a library with -fPIC. 2018-09-28 14:28:19 -04:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
connect.c Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
data.c Pre-beta mechanical code beautification. 2023-05-19 17:24:48 -04:00
descriptor.c Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
ecpglib_extern.h Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
error.c Don't fail on libpq-generated error reports in ecpg_raise_backend(). 2022-06-06 11:20:21 -04:00
execute.c Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
exports.txt Revert "Add DECLARE STATEMENT support to ECPG." 2019-09-20 12:47:37 -04:00
memory.c Remove --disable-thread-safety and related code. 2023-07-12 08:20:43 +12:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
misc.c Avoid concurrent calls to bindtextdomain(). 2024-02-09 11:21:08 -05:00
nls.mk Revert "Use wildcards instead of manually-maintained file lists in */nls.mk." 2022-07-13 14:29:10 -04:00
prepare.c Run pgindent with new pg_bsd_indent version 2.1.1. 2020-05-16 11:54:51 -04:00
sqlda.c Make the order of the header file includes consistent in non-backend modules. 2019-10-25 07:41:52 +05:30
typename.c Make the order of the header file includes consistent in non-backend modules. 2019-10-25 07:41:52 +05:30