From eafdb5db2871e893574fd0da01554d1a50b7471f Mon Sep 17 00:00:00 2001 From: rpj Date: Fri, 24 Jul 1998 12:21:27 +0000 Subject: Fri Jul 24 21:13:55 1998 Ross Johnson * cancel.c (pthread_cancel): Implement. (pthread_testcancel): Implement. * exit.c (pthread_exit): Add comment explaining the longjmp(). * implement.h (_pthread_threads_thread_t): New member cancelthread. (_PTHREAD_YES): Define. (_PTHREAD_NO): Define. (RND_SIZEOF): Remove. * create.c (pthread_create): Rename cancelability to cancelstate. * pthread.h (pthread_attr_t): Rename cancelability to cancelstate. (PTHREAD_CANCELED): Define. --- implement.h | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'implement.h') diff --git a/implement.h b/implement.h index 4a9a5ad..033e0e8 100644 --- a/implement.h +++ b/implement.h @@ -9,6 +9,9 @@ #define _PTHREAD_HASH_INDEX(x) (((ULONG) x) % PTHREAD_THREADS_MAX) +#define _PTHREAD_YES 1 +#define _PTHREAD_NO 0 + /* Handler execution flags. */ #define _PTHREAD_HANDLER_NOEXECUTE 0 #define _PTHREAD_HANDLER_EXECUTE 1 @@ -19,11 +22,6 @@ enum { _PTHREAD_HANDLER_POP_LIFO, _PTHREAD_HANDLER_POP_FIFO }; /* Special value to mark attribute objects as valid. */ #define _PTHREAD_ATTR_INVALID 0xC0FFEE -/* Round a sizeof(type) up to a multiple of sizeof(DWORD). - This is all compile time arithmetic. - */ -#define RND_SIZEOF(T) (((sizeof(T) / sizeof(DWORD)) + 1) * sizeof(DWORD)) - /* General description of a handler function on a stack. */ typedef struct _pthread_handler_node _pthread_handler_node_t; @@ -52,6 +50,7 @@ struct _pthread_threads_thread { pthread_t thread; pthread_attr_t attr; _pthread_call_t call; + int cancelthread; void ** joinvalueptr; _pthread_handler_node_t * cleanupstack; _pthread_handler_node_t * destructorstack; -- cgit v1.2.3