summaryrefslogtreecommitdiff
path: root/dll.c
diff options
context:
space:
mode:
Diffstat (limited to 'dll.c')
-rw-r--r--dll.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/dll.c b/dll.c
index 5900ed9..83edcce 100644
--- a/dll.c
+++ b/dll.c
@@ -22,6 +22,10 @@
/* Global index for TLS data. */
DWORD _pthread_threadID_TlsIndex;
+/* Global index for thread TSD key array. */
+DWORD _pthread_TSD_keys_TlsIndex;
+
+
BOOL WINAPI PthreadsEntryPoint(HINSTANCE dllHandle,
DWORD reason,
LPVOID situation)
@@ -42,9 +46,18 @@ BOOL WINAPI PthreadsEntryPoint(HINSTANCE dllHandle,
{
return FALSE;
}
+
+ /* Set up per thread TSD key array pointer. */
+ _pthread_TSD_keys_TlsIndex = TlsAlloc();
+
+ if (_pthread_TSD_keys_TlsIndex == 0xFFFFFFFF)
+ {
+ return FALSE;
+ }
break;
case DLL_PROCESS_DETACH:
+ (void) TlsFree(_pthread_TSD_keys_TlsIndex);
(void) TlsFree(_pthread_threadID_TlsIndex);
break;