Ticket #13116 (closed defect: fixed)
Thread Local Storage does not work with DLLs loaded using LoadLibrary
|Reported by:||disc||Owned by:|
|Keywords:||WinXP TLS DLL||Cc:|
See PRB: Calling LoadLibrary() to Load a DLL That Has Static TLS and optionally this series on TLS for more in-depth information.
In the best case LoadLibrary fails (Windows 95) but with later systems you will get an access violation at some point (if you're lucky when first accessing a __declspec(thread) variable).
It would be unfortunate to, by default, disable TLS compiler support for MSW but I don't see an alternative currently.
This applies to XP/Windows Server 2003 and earlier systems and for example occurs with Photoshop plug-ins.