Re: Cleaning up threading code

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Andres Freund <andres@anarazel.de>, Thomas Munro <thomas.munro@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-07-03T07:29:34Z
Lists: pgsql-hackers
On 10.06.23 07:26, Andres Freund wrote:
>> -###############################################################
>> -# Threading
>> -###############################################################
>> -
>> -# XXX: About to rely on thread safety in the autoconf build, so not worth
>> -# implementing a fallback.
>> -cdata.set('ENABLE_THREAD_SAFETY', 1)
> 
> I wonder if we should just unconditionally set that in c.h or such? It'd not
> be crazy for external projects to rely on that being set.

We definitely should keep the mention in ecpg_config.h.in, since that is 
explicitly put there for client code to use.  We keep HAVE_LONG_LONG_INT 
etc. there for similar reasons.

Another comment on patch 0003:  I think this removal in configure.ac is 
too much:

-    else
-      LDAP_LIBS_FE="-lldap $EXTRA_LDAP_LIBS"

This could would still be reachable for $enable_thread_safety=yes and 
$thread_safe_libldap=yes, which I suppose is the normal case?



Commits

  1. Doc: Adjust libpq docs about thread safety.

  2. Remove --disable-thread-safety and related code.

  3. Rename port/thread.c to port/user.c.

  4. Remove obsolete comment and code from fe-auth.c.