From 10f173691b6929033d5714cde8a33f4477aaba28 Mon Sep 17 00:00:00 2001 From: rpj Date: Mon, 3 Aug 1998 15:27:21 +0000 Subject: Tue Aug 4 00:09:30 1998 Ross Johnson * implement.h(_pthread_virgins): Add extern. (_pthread_virgin_next): Ditto. (_pthread_reuse): Ditto. (_pthread_reuse_top): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * global.c (_pthread_virgins): Changed from array to pointer. Storage allocation for the array moved into dll.c. (_pthread_reuse): Ditto. (_pthread_win32handle_map): Ditto. (_pthread_threads_mutex_table): Ditto. * dll.c (PthreadsEntryPoint): Set up thread admin storage when DLL is loaded. * fork.c (pthread_atfork): Fix function pointer arg to all _pthread_handler_push() calls. Change "arg" arg to NULL in child push. * exit.c: Add windows.h and process.h includes. (_pthread_exit): Add local detachstate declaration. (_pthread_exit): Fix incorrect name for pthread_attr_getdetachstate(). * pthread.h (_POSIX_THREAD_ATTR_STACKSIZE): Move from global.c (_POSIX_THREAD_ATTR_STACKADDR): Ditto. * create.c (pthread_create): Fix #if should be #ifdef. (_pthread_start_call): Remove usused variables. * process.h: Create. * windows.h: Move _beginthreadex and _endthreadex into process.h Mon Aug 3 21:19:57 1998 Ross Johnson * condvar.c (pthread_cond_init): Add NULL attr to pthread_mutex_init() call - default attributes will be used. (cond_wait): Fix typo. (cond_wait): Fix typo - cv was ev. (pthread_cond_broadcast): Fix two identical typos. * cleanup.c (_pthread_destructor_pop_all): Remove _ prefix from PTHREAD_DESTRUCTOR_ITERATIONS. * pthread.h: Move _POSIX_* values into posix.h * pthread.h: Fix typo in pthread_mutex_init() prototype. * attr.c (pthread_attr_init): Fix error in priority member init. * windows.h (THREAD_PRIORITY_NORMAL): Add. * pthread.h (sched_param): Add missing ';' to struct definition. * attr.c (pthread_attr_init): Remove obsolete pthread_attr_t member initialisation - cancelstate, canceltype, cancel_pending. (is_attr): Make arg "attr" a const. * implement.h (_PTHREAD_HANDLER_POP_LIFO): Remove definition. (_PTHREAD_HANDLER_POP_FIFO): Ditto. (_PTHREAD_VALID): Add missing newline escape (\). (_pthread_handler_node): Make element "next" a pointer. --- global.c | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) (limited to 'global.c') diff --git a/global.c b/global.c index 9db37af..01f6a40 100644 --- a/global.c +++ b/global.c @@ -11,18 +11,15 @@ #include "pthread.h" #include "implement.h" -#define PTHREAD_THREADS_MAX 128 -#define PTHREAD_STACK_MIN 65535 - -/* Convert these to defined when implemented. */ -#define _POSIX_THREAD_ATTR_STACKSIZE -#ifdef _POSIX_THREAD_ATTR_STACKADDR -#undef _POSIX_THREAD_ATTR_STACKADDR -#endif - /* Making these constants will mean that applications remain binary compatible between versions of the DLL. */ +/* POSIX run-time invariant values. (Currently POSIX minimum values) */ +const int _POSIX_THREAD_THREADS_MAX = 128; +const int _POSIX_THREAD_DESTRUCTOR_ITERATIONS = 4; +const int _POSIX_THREAD_KEYS_MAX = 128; + + const int _pthread_create_joinable = 0; const int _pthread_create_detached = 1; @@ -33,21 +30,23 @@ const int _pthread_cancel_disable = 1; const int _pthread_cancel_asynchronous = 0; const int _pthread_cancel_deferred = 1; +/* FIXME: This is temporary. */ +#define PTHREAD_MUTEX_INITIALIZER {0} pthread_mutex_t _pthread_table_mutex = PTHREAD_MUTEX_INITIALIZER; DWORD _pthread_threads_count = 0; /* Per thread management storage. See comments in private.c */ -_pthread_t _pthread_virgins[PTHREAD_THREADS_MAX]; +_pthread_t * _pthread_virgins; int _pthread_virgin_next = 0; -pthread_t _pthread_reuse[PTHREAD_THREADS_MAX]; +pthread_t * _pthread_reuse; int _pthread_reuse_top = -1; -pthread_t _pthread_win32handle_map[PTHREAD_THREADS_MAX]; +pthread_t * _pthread_win32handle_map; /* Per thread mutex locks. */ -pthread_mutex_t _pthread_threads_mutex_table[PTHREAD_THREADS_MAX]; +pthread_mutex_t * _pthread_threads_mutex_table; -- cgit v1.2.3