Re: Avoiding concurrent calls to bindtextdomain()

2024-02-08 Thread Tom Lane
I wrote: > 0001 also gets rid of the possibility that pthread_mutex_init/ > pthread_mutex_lock could fail due to malloc failure. This seems > important since default_threadlock() assumes that pthread_mutex_lock > cannot fail in practice. I observe that ecpglib also assumes that, > although it's

Avoiding concurrent calls to bindtextdomain()

2024-02-05 Thread Tom Lane
According to the discussion in [1], it's not as safe as we supposed to allow different threads to call bindtextdomain() concurrently. Here is a patchset to prevent that by acquiring a mutex around the libpq and ecpglib calls that are at risk. In libpq, this would've required yet a third copy of