summaryrefslogtreecommitdiff
path: root/private.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-30 13:51:57 +0000
committerrpj <rpj>1998-07-30 13:51:57 +0000
commit94cfb27da3941eea2b20867eacc09a5b91168438 (patch)
treefaf0cfaab11409e9f4aa047f897dd82ca345ed56 /private.c
parent96600f6d50eeeef1f660352b8455d4df1aed69ff (diff)
Thu Jul 30 23:12:45 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* implement.h: Remove _pthread_find_entry() prototype. * private.c: Extend comments. Remove _pthread_find_entry() - no longer needed. * create.c (_pthread_start_call): Add call to TlsSetValue() to store the thread ID. * dll.c (PthreadsEntryPoint): Implement. This is called whenever a process loads the DLL. Used to initialise thread local storage. * implement.h: Add _pthread_threadID_TlsIndex. Add ()s around _PTHREAD_VALID expression. * misc.c (pthread_self): Re-implement using Win32 TLS to store the threads own ID.
Diffstat (limited to 'private.c')
-rw-r--r--private.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/private.c b/private.c
index 2ac2e31..454695d 100644
--- a/private.c
+++ b/private.c
@@ -95,6 +95,22 @@
_pthread_reuse[++_pthread_reuse_top] = thread;
+
+ We still need a means for pthread_self() to return its own thread
+ ID.
+
+ We use the Win32 Thread Local Storage mechanism. A single call to
+ TlsAlloc() will make available a single 32 bit location to every
+ thread in the process, including those created after the call is
+ made.
+
+ Provided we don't need to call pthread_self() after the Win32
+ thread has terminated we can use the DLL entry point routine to
+ initialise TLS for each thread. Or we can use pthread_once() in
+ pthread_create() to do it.
+
+ We can use either option. We'll use the DLL entry point routine.
+
*/
int
@@ -136,12 +152,6 @@ _pthread_new_thread(pthread_t * thread)
return 0;
}
-pthread_t
-_pthread_find_thread((HANDLE) win32handle)
-{
- /* FIXME: No-op at present */
-}
-
int
_pthread_delete_thread(_pthread_t * thread)
{