From 9ff4d7a4815f0e20f1dc95e9a9e91b55eee7459a Mon Sep 17 00:00:00 2001 From: rpj Date: Tue, 4 Aug 1998 08:01:05 +0000 Subject: Tue Aug 4 16:57:58 1998 Ross Johnson * 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. --- global.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'global.c') diff --git a/global.c b/global.c index 01f6a40..2914fb7 100644 --- a/global.c +++ b/global.c @@ -30,6 +30,9 @@ const int _pthread_cancel_disable = 1; const int _pthread_cancel_asynchronous = 0; const int _pthread_cancel_deferred = 1; + +/* Declare variables which are global to all threads in the process. */ + /* FIXME: This is temporary. */ #define PTHREAD_MUTEX_INITIALIZER {0} @@ -38,15 +41,22 @@ 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; +/* An array of struct _pthread */ +_pthread_t _pthread_virgins[]; +/* Index to the next available previously unused struct _pthread */ int _pthread_virgin_next = 0; -pthread_t * _pthread_reuse; +/* An array of pointers to struct _pthread */ +pthread_t _pthread_reuse[]; +/* Index to the first available reusable pthread_t. */ int _pthread_reuse_top = -1; -pthread_t * _pthread_win32handle_map; +/* An array of pointers to struct _pthread indexed by hashing + the Win32 handle. */ +pthread_t _pthread_win32handle_map[]; /* Per thread mutex locks. */ -pthread_mutex_t * _pthread_threads_mutex_table; +pthread_mutex_t _pthread_threads_mutex_table[]; + -- cgit v1.2.3