summaryrefslogtreecommitdiffstats
path: root/src/gallium/targets/libgl-gdi
diff options
context:
space:
mode:
authorRob Schneider <Swizzle@t-online.de>2013-01-15 11:49:12 -0800
committerJosé Fonseca <jfonseca@vmware.com>2013-01-15 14:16:09 -0800
commit45575ff388cbb4c49480c6e5e8eea32d5c7d74a4 (patch)
tree7e285dda940b2550bd1376631d5c33354c16d35b /src/gallium/targets/libgl-gdi
parenteb09940e55806c36890ae8f5a35ad1b37ed74832 (diff)
downloadexternal_mesa3d-45575ff388cbb4c49480c6e5e8eea32d5c7d74a4.zip
external_mesa3d-45575ff388cbb4c49480c6e5e8eea32d5c7d74a4.tar.gz
external_mesa3d-45575ff388cbb4c49480c6e5e8eea32d5c7d74a4.tar.bz2
libgl-gdi: Avoid hangs on DLL_PROCESS_DETACH.
At process exit DLL_PROCESS_DETACH is signaled to DllMain(), where then a final cleanup is triggered. In stw_cleanup() code is triggered that tries to communicate a shutdown to the spawned threads -- however at that time those threads have already been terminated by the OS and so the process hangs. v2: skip stw_cleanup_thread() too Signed-off-by: José Fonseca <jfonseca@vmware.com>
Diffstat (limited to 'src/gallium/targets/libgl-gdi')
-rw-r--r--src/gallium/targets/libgl-gdi/libgl_gdi.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gallium/targets/libgl-gdi/libgl_gdi.c b/src/gallium/targets/libgl-gdi/libgl_gdi.c
index 112904a..3f7dc00 100644
--- a/src/gallium/targets/libgl-gdi/libgl_gdi.c
+++ b/src/gallium/targets/libgl-gdi/libgl_gdi.c
@@ -159,8 +159,10 @@ DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved)
break;
case DLL_PROCESS_DETACH:
- stw_cleanup_thread();
- stw_cleanup();
+ if (lpReserved == NULL) {
+ stw_cleanup_thread();
+ stw_cleanup();
+ }
break;
}
return TRUE;