On 4/12/25 00:39, Bruno Haible via Gnulib discussion list wrote:
POSIX [1] says about localeconv():
"The localeconv() function need not be thread-safe; however, localeconv()
shall avoid data races with all other functions."
[1]https://pubs.opengroup.org/onlinepubs/9799919799/functions/localeconv.html
It's not exactly clear to me what this means. What is relevant for library
code is that one can call localeconv() and access the elements of the result,
when no other thread calls setlocale() or the same thread does not call
uselocale().
To me it means that if two threads simultanously call localeconv and any
other function (including setlocale and uselocale!), localeconv might
have a data race. However, if two threads simultanously call localeconv
you might have a data race and the result might not be valid.