summaryrefslogtreecommitdiff
path: root/exports
diff options
context:
space:
mode:
authorErik M. Bray <erik.bray@lri.fr>2019-03-18 20:32:48 +0100
committerErik M. Bray <erik.bray@lri.fr>2019-03-19 09:26:50 +0100
commit4ad694eda1ff79040778648d44cda5b8f774c38d (patch)
tree94e0ba8e30649e38d406f542714b10bd5e5fc1e1 /exports
parent4fc17d0d754b7905667fb84a68cf37a0d28a93bd (diff)
downloadopenblas-4ad694eda1ff79040778648d44cda5b8f774c38d.tar.gz
openblas-4ad694eda1ff79040778648d44cda5b8f774c38d.tar.bz2
openblas-4ad694eda1ff79040778648d44cda5b8f774c38d.zip
Fix for #2063: The DllMain used in Cygwin did not run the thread memory
pool cleanup upon THREAD_DETACH which is needed when compiled with USE_TLS=1.
Diffstat (limited to 'exports')
-rw-r--r--exports/dllinit.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/exports/dllinit.c b/exports/dllinit.c
index 02ff092e9..0e1bb34e3 100644
--- a/exports/dllinit.c
+++ b/exports/dllinit.c
@@ -40,15 +40,25 @@
void gotoblas_init(void);
void gotoblas_quit(void);
+#if defined(SMP) && defined(USE_TLS)
+void blas_thread_memory_cleanup(void);
+#endif
BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD reason, LPVOID reserved) {
-
- if (reason == DLL_PROCESS_ATTACH) {
- gotoblas_init();
- }
-
- if (reason == DLL_PROCESS_DETACH) {
- gotoblas_quit();
+ switch(reason) {
+ case DLL_PROCESS_ATTACH:
+ gotoblas_init();
+ break;
+ case DLL_PROCESS_DETACH:
+ gotoblas_quit();
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+#if defined(SMP) && defined(USE_TLS)
+ blas_thread_memory_cleanup(void);
+#endif
+ break;
}
return TRUE;