summaryrefslogtreecommitdiff
path: root/attr.c
diff options
context:
space:
mode:
authorrpj <rpj>1998-07-25 12:27:18 +0000
committerrpj <rpj>1998-07-25 12:27:18 +0000
commit860f5268e2d230e4fc04ab588f74ea5e05bab44a (patch)
tree2aa1da3bc97970139101d61318bbf1c41c0056c4 /attr.c
parente80271449742bf9c3f1e54312fbc5af6f413ff35 (diff)
Sat Jul 25 00:00:13 1998 Ross Johnson <rpj@ixobrychus.canberra.edu.au>
* create.c (_pthread_start_call): Set thread priority. Ensure our thread entry is removed from the thread table but only if pthread_detach() was called and there are no waiting joins. (pthread_create): Set detach flag in thread entry if the thread is created PTHREAD_CREATE_DETACHED. * pthread.h (pthread_attr_t): Rename member "detachedstate". * attr.c (pthread_attr_init): Rename attr members. * exit.c (pthread_exit): Fix indirection mistake. * implement.h (_PTHREAD_THREADS_TABLE_INDEX): Add. * exit.c (_pthread_vacuum): Fix incorrect args to _pthread_handler_pop_all() calls. Make thread entry removal conditional. * sync.c (pthread_join): Add multiple join and async detach handling. * implement.h (_PTHREAD_THREADS_TABLE_INDEX): Add. * global.c (_pthread_threads_mutex_table): Add. * implement.h (_pthread_once_flag): Remove. (_pthread_once_lock): Ditto. (_pthread_threads_mutex_table): Add. * global.c (_pthread_once_flag): Remove. (_pthread_once_lock): Ditto. * sync.c (pthread_join): Fix tests involving new return value from _pthread_find_thread_entry(). (pthread_detach): Ditto. * private.c (_pthread_find_thread_entry): Failure return code changed from -1 to NULL.
Diffstat (limited to 'attr.c')
-rw-r--r--attr.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/attr.c b/attr.c
index 22332c0..65c00a0 100644
--- a/attr.c
+++ b/attr.c
@@ -98,9 +98,14 @@ pthread_attr_init(pthread_attr_t *attr)
attr->stacksize = PTHREAD_STACK_MIN;
#endif
- attr->cancelability = PTHREAD_CANCEL_ENABLE;
+ attr->cancelstate = PTHREAD_CANCEL_ENABLE;
attr->canceltype = PTHREAD_CANCEL_DEFERRED;
- attr->detached = PTHREAD_CREATE_JOINABLE;
+ attr->detachedstate = PTHREAD_CREATE_JOINABLE;
+ memset(&(attr->sigmask), 0, sizeof(sigset_t));
+
+ /* Priority uses Win32 priority values. */
+ int priority = THREAD_PRIORITY_NORMAL;
+
attr->valid = 0;
return 0;