Home | History | Annotate | Download | only in libpthread

Lines Matching defs:newthread

336 pthread__getstack(pthread_t newthread, const pthread_attr_t *attr)
356 if (newthread->pt_stack_allocated) {
358 newthread->pt_stack.ss_size == stacksize &&
359 newthread->pt_guardsize == guardsize)
361 stackbase2 = newthread->pt_stack.ss_sp;
363 stackbase2 = (char *)stackbase2 - newthread->pt_guardsize;
366 newthread->pt_stack.ss_size + newthread->pt_guardsize);
367 newthread->pt_stack.ss_sp = NULL;
368 newthread->pt_stack.ss_size = 0;
369 newthread->pt_guardsize = 0;
370 newthread->pt_stack_allocated = false;
373 newthread->pt_stack_allocated = false;
398 newthread->pt_stack.ss_size = stacksize;
399 newthread->pt_stack.ss_sp = stackbase2;
400 newthread->pt_guardsize = guardsize;
401 newthread->pt_stack_allocated = allocated;
409 pthread_t newthread;
467 newthread = NULL;
474 PTQ_FOREACH(newthread, &pthread__deadqueue, pt_deadq) {
476 if (_lwp_kill(newthread->pt_lid, 0) == -1 &&
480 if (newthread)
481 PTQ_REMOVE(&pthread__deadqueue, newthread, pt_deadq);
484 if (newthread && newthread->pt_tls) {
485 _rtld_tls_free(newthread->pt_tls);
486 newthread->pt_tls = NULL;
495 if (newthread == NULL) {
496 newthread = calloc(1, __pthread_st_size);
497 if (newthread == NULL) {
501 newthread->pt_stack_allocated = false;
503 if (pthread__getstack(newthread, attr)) {
504 free(newthread);
510 newthread->pt_tls = NULL;
515 PTQ_INSERT_TAIL(&pthread__allqueue, newthread, pt_allq);
516 (void)rb_tree_insert_node(&pthread__alltree, newthread);
520 pthread__initthread(newthread);
522 if (pthread__getstack(newthread, attr)) {
524 PTQ_INSERT_TAIL(&pthread__deadqueue, newthread, pt_deadq);
533 pthread__scrubthread(newthread, name, nattr.pta_flags);
534 newthread->pt_func = startfunc;
535 newthread->pt_arg = arg;
537 private_area = newthread->pt_tls = _rtld_tls_allocate();
538 newthread->pt_tls->tcb_pthread = newthread;
540 private_area = newthread;
544 if ((newthread->pt_flags & PT_FLAG_SUSPENDED) != 0 ||
547 if ((newthread->pt_flags & PT_FLAG_DETACHED) != 0)
550 ret = pthread__makelwp(pthread__create_tramp, newthread, private_area,
551 newthread->pt_stack.ss_sp, newthread->pt_stack.ss_size,
552 flag, &newthread->pt_lid);
555 pthread_mutex_lock(&newthread->pt_lock);
557 pthread__reap(newthread);
563 (void)pthread_setschedparam(newthread, p->ptap_policy,
566 if ((newthread->pt_flags & PT_FLAG_SUSPENDED) == 0) {
567 (void)_lwp_continue(newthread->pt_lid);
571 *thread = newthread;