summaryrefslogtreecommitdiff
path: root/global.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-08-04 08:01:05 +0000
committerrpj <rpj>1998-08-04 08:01:05 +0000
commit9ff4d7a4815f0e20f1dc95e9a9e91b55eee7459a (patch)
treec498419490efabb58635a95bb6d910a6f21ddc10 /global.c
parent10f173691b6929033d5714cde8a33f4477aaba28 (diff)
Tue Aug 4 16:57:58 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* 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.
Diffstat (limited to 'global.c')
-rw-r--r--global.c18
1 files changed, 14 insertions, 4 deletions
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[];
+