aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/threads.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-17 01:09:25 -0700
committerChris Robinson <[email protected]>2014-04-17 01:09:25 -0700
commitfbb4cbbe01b9ba2fa7b6c2450d2755c244d15151 (patch)
treed538cf6b722def304bf9195dd8bc8f38b17b804a /Alc/threads.c
parente5d39a5f4c871183c7e409abff3c3a6d6c40bf17 (diff)
Keep TlsDestructors within threads.c
This basically makes the threads implementation self-contained in threads.c and threads.h, except for the UIntMap/RWLock implementations.
Diffstat (limited to 'Alc/threads.c')
-rw-r--r--Alc/threads.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/Alc/threads.c b/Alc/threads.c
index ca004903..cf9e5bed 100644
--- a/Alc/threads.c
+++ b/Alc/threads.c
@@ -205,12 +205,17 @@ int almtx_timedlock(almtx_t *mtx, const struct timespec *ts)
* function pointer in a ".CRT$XLx" section (where x is a character A to Z)
* ensures the CRT will call it similar to DllMain.
*/
-UIntMap TlsDestructors;
+static UIntMap TlsDestructors = UINTMAP_STATIC_INITIALIZE;
static void NTAPI altss_callback(void* UNUSED(handle), DWORD reason, void* UNUSED(reserved))
{
ALsizei i;
+ if(reason == DLL_PROCESS_DETACH)
+ {
+ ResetUIntMap(&TlsDestructors);
+ return;
+ }
if(reason != DLL_THREAD_DETACH)
return;