diff options
author | rpj <rpj> | 1998-07-28 05:08:58 +0000 |
---|---|---|
committer | rpj <rpj> | 1998-07-28 05:08:58 +0000 |
commit | 50096a2db46759c1a94647838ec84919af81584c (patch) | |
tree | cbb4f86d621cf9ad855b3fb9c2ff6ec31e10f6a5 /create.c | |
parent | 70831b26a1608227f7cf91a9ef07376fe4620b26 (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.
Diffstat (limited to 'create.c')
-rw-r--r-- | create.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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 */ |