summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-28 05:08:58 +0000
committerrpj <rpj>1998-07-28 05:08:58 +0000
commit50096a2db46759c1a94647838ec84919af81584c (patch)
treecbb4f86d621cf9ad855b3fb9c2ff6ec31e10f6a5
parent70831b26a1608227f7cf91a9ef07376fe4620b26 (diff)
Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au>
* create.c (_pthread_start_call): Insert missing ")". Add "us" arg to _pthread_exit() call. (pthread_create): Modify to use new thread allocation scheme.
-rw-r--r--ChangeLog4
-rw-r--r--create.c14
2 files changed, 12 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f876fbe..d3f7141 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
Tue Jul 28 14:04:29 1998 Ross Johnson <rpj@swan.canberra.edu.au>
+ * create.c (_pthread_start_call): Insert missing ")".
+ Add "us" arg to _pthread_exit() call.
+ (pthread_create): Modify to use new thread allocation scheme.
+
* private.c: Added detailed explanation of the new thread
allocation scheme.
(_pthread_new_thread): Totally rewritten to use
diff --git a/create.c b/create.c
index 61c5aff..71744c9 100644
--- a/create.c
+++ b/create.c
@@ -32,7 +32,7 @@ _pthread_start_call(void * us_arg)
that our records reflect true reality. */
if (SetThreadPriority((HANDLE) us->win32handle, us->attr.priority) == FALSE)
{
- us->attr.priority = GetThreadPriority((HANDLE) us->win32handle;
+ us->attr.priority = GetThreadPriority((HANDLE) us->win32handle);
}
func = us->call.routine;
@@ -40,7 +40,7 @@ _pthread_start_call(void * us_arg)
ret = (*func)(arg);
- _pthread_exit(NULL, ret);
+ _pthread_exit(us, NULL, ret);
/* Never Reached */
}
@@ -56,14 +56,14 @@ pthread_create(pthread_t *thread,
void * security = NULL;
DWORD threadID;
pthread_attr_t * attr_copy;
- pthread_t * usptr;
+ pthread_t us;
/* Success unless otherwise set. */
int ret;
/* CRITICAL SECTION */
pthread_mutex_lock(&_pthread_table_mutex);
- ret = _pthread_new_thread_entry((pthread_t) handle, usptr);
+ ret = _pthread_new_thread(&us);
pthread_mutex_lock(&_pthread_table_mutex);
/* END CRITICAL SECTION */
@@ -111,7 +111,9 @@ pthread_create(pthread_t *thread,
if (ret == 0)
{
/* Let the caller know the thread handle. */
- *thread = (pthread_t) handle;
+ us->win32handle = handle;
+ us->ptstatus = _PTHREAD_INUSE;
+ *thread = (pthread_t) us;
}
else
{
@@ -119,7 +121,7 @@ pthread_create(pthread_t *thread,
pthread_mutex_lock(&_pthread_table_mutex);
/* Remove the failed thread entry. */
- _pthread_delete_thread_entry(us);
+ _pthread_delete_thread(us);
pthread_mutex_lock(&_pthread_table_mutex);
/* END CRITICAL SECTION */