diff options
Diffstat (limited to 'lib/libthr/thread/thr_create.c')
-rw-r--r-- | lib/libthr/thread/thr_create.c | 25 |
1 files changed, 1 insertions, 24 deletions
diff --git a/lib/libthr/thread/thr_create.c b/lib/libthr/thread/thr_create.c index 41019ad..f1a6301 100644 --- a/lib/libthr/thread/thr_create.c +++ b/lib/libthr/thread/thr_create.c @@ -97,20 +97,11 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, } /* Initialise the thread structure: */ - memset(new_thread, 0, sizeof(struct pthread)); + init_td_common(new_thread, pattr, 0); new_thread->stack = stack; new_thread->start_routine = start_routine; new_thread->arg = arg; - new_thread->cancelflags = PTHREAD_CANCEL_ENABLE | - PTHREAD_CANCEL_DEFERRED; - - /* - * Write a magic value to the thread structure - * to help identify valid ones: - */ - new_thread->magic = PTHREAD_MAGIC; - /* Initialise the machine context: */ getcontext(&new_thread->ctx); new_thread->ctx.uc_stack.ss_sp = new_thread->stack; @@ -128,9 +119,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, return (ret); } - /* Copy the thread attributes: */ - memcpy(&new_thread->attr, pattr, sizeof(struct pthread_attr)); - /* * Check if this thread is to inherit the scheduling * attributes from its parent: @@ -153,17 +141,6 @@ _pthread_create(pthread_t * thread, const pthread_attr_t * attr, new_thread->active_priority = new_thread->base_priority; new_thread->inherited_priority = 0; - /* Initialize joiner to NULL (no joiner): */ - new_thread->joiner = NULL; - - /* Initialize the mutex queue: */ - TAILQ_INIT(&new_thread->mutexq); - - /* Initialise hooks in the thread structure: */ - new_thread->specific = NULL; - new_thread->cleanup = NULL; - new_thread->flags = 0; - /* * Initialise the unique id which GDB uses to * track threads. |