summaryrefslogtreecommitdiff
path: root/dll.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-10-14 03:06:39 +0000
committerrpj <rpj>1998-10-14 03:06:39 +0000
commit4ed54ca07b8115bd9e7813a1484d4c7936a25e70 (patch)
treedce1f613f881a7fa06b692ea316922473e3d3690 /dll.c
parent7522a5a3b4f87f79534ae134a087d80e3e4bfa8a (diff)
Mon Oct 12 00:00:44 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h (_pthread_tsd_key_table): New. * create.c (_pthread_start_call): Initialise per-thread TSD keys to NULL. * misc.c (pthread_once): Correct typo in comment. * implement.h (_pthread_destructor_push): Remove. (_pthread_destructor_pop): Remove. (_pthread_destructor_run_all): Rename from _pthread_destructor_pop_all. (_PTHREAD_TSD_KEY_DELETED): Add enum. (_PTHREAD_TSD_KEY_INUSE): Add enum. * cleanup.c (_pthread_destructor_push): Remove. (_pthread_destructor_pop): Remove. (_pthread_destructor_run_all): Totally revamped TSD. * dll.c (_pthread_TSD_keys_TlsIndex): Initialise. * tsd.c (pthread_setspecific): Totally revamped TSD. (pthread_getspecific): Ditto. (pthread_create): Ditto. (pthread_delete): Ditto. Sun Oct 11 22:44:55 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au> * global.c (_pthread_tsd_key_table): Add new global. * implement.h (_pthread_tsd_key_t and struct _pthread_tsd_key): Add. (struct _pthread): Remove destructorstack. * cleanup.c (_pthread_destructor_run_all): Rename from _pthread_destructor_pop_all. The key destructor stack was made global rather than per-thread. No longer removes destructor nodes from the stack. Comments updated.
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;