From 0c57f42f9e1bd459a95596b4d70e06f9a7b31148 Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 24 Jul 1998 03:58:18 +0000 Subject: * sync.c (pthread_join): Save valueptr arg in joinvalueptr for pthread_exit() to use. * private.c (_pthread_new_thread_entry): Initialise joinvalueptr to NULL. * create.c (_pthread_start_call): Rewrite to facilitate joins. pthread_exit() will do a longjmp() back to here. Does appropriate cleanup and exit/return from the thread. (pthread_create): _beginthreadex() now passes a pointer to our thread table entry instead of just the call member of that entry. * implement.h (_pthread_threads_thread): New member void ** joinvalueptr. (_pthread_call_t): New member jmpbuf env. * exit.c (pthread_exit): Major rewrite to handle joins and handing value pointer to joining thread. Uses longjmp() back to _pthread_start_call(). --- implement.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'implement.h') diff --git a/implement.h b/implement.h index 14fbdbb..b72e273 100644 --- a/implement.h +++ b/implement.h @@ -37,6 +37,7 @@ struct _pthread_handler_node { typedef struct { unsigned (*routine)(void *); void * arg; + jmpbuf env; } _pthread_call_t; #define _PTHREAD_THIS (_pthread_find_thread_entry(pthread_this())) @@ -51,6 +52,7 @@ struct _pthread_threads_thread { pthread_t thread; pthread_attr_t attr; _pthread_call_t call; + void ** joinvalueptr; _pthread_handler_node_t * cleanupstack; _pthread_handler_node_t * destructorstack; _pthread_handler_node_t * forkpreparestack; -- cgit v1.2.3