summaryrefslogtreecommitdiff
path: root/misc.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-08-04 08:01:05 +0000
committerrpj <rpj>1998-08-04 08:01:05 +0000
commit9ff4d7a4815f0e20f1dc95e9a9e91b55eee7459a (patch)
treec498419490efabb58635a95bb6d910a6f21ddc10 /misc.c
parent10f173691b6929033d5714cde8a33f4477aaba28 (diff)
Tue Aug 4 16:57:58 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* private.c (_pthread_delete_thread): Fix typo. Add missing ';'. * global.c (_pthread_virgins): Change types from pointer to array pointer. (_pthread_reuse): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * implement.h(_pthread_virgins): Change types from pointer to array pointer. (_pthread_reuse): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * private.c (_pthread_delete_thread): Fix "entry" should be "thread". * misc.c (pthread_self): Add extern for _pthread_threadID_TlsIndex. * global.c: Add comment. * misc.c (pthread_once): Fix member -> dereferences. Change _pthread_once_flag to once_control->flag in "if" test.
Diffstat (limited to 'misc.c')
-rw-r--r--misc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/misc.c b/misc.c
index ca39513..7905488 100644
--- a/misc.c
+++ b/misc.c
@@ -25,12 +25,12 @@ pthread_once(pthread_once_t *once_control,
the DLL is unloaded. */
/* An atomic test-and-set of the "once" flag. */
- EnterCriticalSection(once_control.lock);
- if (_pthread_once_flag == 0)
+ EnterCriticalSection(once_control->lock);
+ if (once_control->flag == 0)
{
flag = once_control->flag = 1;
}
- LeaveCriticalSection(once_control.lock);
+ LeaveCriticalSection(once_control->lock);
if (flag)
{
@@ -45,6 +45,8 @@ pthread_t
pthread_self(void)
{
pthread_t ret;
+ /* This TLS index is allocated on DLL load by dll.c */
+ extern DWORD _pthread_threadID_TlsIndex;
ret = (pthread_t) TlsGetValue(_pthread_threadID_TlsIndex);