Eli Zaretskii <e...@gnu.org> writes: > . __thread works as expected in MinGW GCC since version 4.5.0 > > . DLLs that use __thread (a.k.a. "implicit TLS") cannot be safely > loaded at run time, using LoadLibrary, on Windows versions before > Vista, they can only be loaded at program startup time (IOW, the > corresponding -lLIBRARY switch should be passed on the link > command line) > > . DLLs that need to be able to support LoadLibrary on Windows XP and > older need to use explicit TLS API functions, which requires a > call to TlsAlloc in the DllMain function, another complication
Thanks for checking in detail. Then it would make more sense to use locking rather than TLS. > Actually, I see that libunistring already includes functions for > locking (which on Windows wrap the 2 APIs I mentioned above). So I > guess it's best to use them. Yes, could you create a patch in that direction? By the way, though a minor nitpicking, the indentation in gl_locale_name_thread still doesn't look correct (there is a variable declaration in the middle of block). Regards, -- Daiki Ueno