Lines Matching refs:newthread

326 pthread__getstack(pthread_t newthread, const pthread_attr_t *attr)  in pthread__getstack()  argument
346 if (newthread->pt_stack_allocated) { in pthread__getstack()
348 newthread->pt_stack.ss_size == stacksize && in pthread__getstack()
349 newthread->pt_guardsize == guardsize) in pthread__getstack()
351 stackbase2 = newthread->pt_stack.ss_sp; in pthread__getstack()
353 stackbase2 = (char *)stackbase2 - newthread->pt_guardsize; in pthread__getstack()
356 newthread->pt_stack.ss_size + newthread->pt_guardsize); in pthread__getstack()
357 newthread->pt_stack.ss_sp = NULL; in pthread__getstack()
358 newthread->pt_stack.ss_size = 0; in pthread__getstack()
359 newthread->pt_guardsize = 0; in pthread__getstack()
360 newthread->pt_stack_allocated = false; in pthread__getstack()
363 newthread->pt_stack_allocated = false; in pthread__getstack()
388 newthread->pt_stack.ss_size = stacksize; in pthread__getstack()
389 newthread->pt_stack.ss_sp = stackbase2; in pthread__getstack()
390 newthread->pt_guardsize = guardsize; in pthread__getstack()
391 newthread->pt_stack_allocated = allocated; in pthread__getstack()
399 pthread_t newthread; in pthread_create() local
457 newthread = NULL; in pthread_create()
464 PTQ_FOREACH(newthread, &pthread__deadqueue, pt_deadq) { in pthread_create()
466 if (_lwp_kill(newthread->pt_lid, 0) == -1 && in pthread_create()
470 if (newthread) in pthread_create()
471 PTQ_REMOVE(&pthread__deadqueue, newthread, pt_deadq); in pthread_create()
474 if (newthread && newthread->pt_tls) { in pthread_create()
475 _rtld_tls_free(newthread->pt_tls); in pthread_create()
476 newthread->pt_tls = NULL; in pthread_create()
485 if (newthread == NULL) { in pthread_create()
486 newthread = calloc(1, __pthread_st_size); in pthread_create()
487 if (newthread == NULL) { in pthread_create()
491 newthread->pt_stack_allocated = false; in pthread_create()
493 if (pthread__getstack(newthread, attr)) { in pthread_create()
494 free(newthread); in pthread_create()
500 newthread->pt_tls = NULL; in pthread_create()
505 PTQ_INSERT_TAIL(&pthread__allqueue, newthread, pt_allq); in pthread_create()
506 (void)rb_tree_insert_node(&pthread__alltree, newthread); in pthread_create()
510 pthread__initthread(newthread); in pthread_create()
512 if (pthread__getstack(newthread, attr)) { in pthread_create()
514 PTQ_INSERT_TAIL(&pthread__deadqueue, newthread, pt_deadq); in pthread_create()
523 pthread__scrubthread(newthread, name, nattr.pta_flags); in pthread_create()
524 newthread->pt_func = startfunc; in pthread_create()
525 newthread->pt_arg = arg; in pthread_create()
527 private_area = newthread->pt_tls = _rtld_tls_allocate(); in pthread_create()
528 newthread->pt_tls->tcb_pthread = newthread; in pthread_create()
530 private_area = newthread; in pthread_create()
534 if ((newthread->pt_flags & PT_FLAG_SUSPENDED) != 0 || in pthread_create()
537 if ((newthread->pt_flags & PT_FLAG_DETACHED) != 0) in pthread_create()
540 ret = pthread__makelwp(pthread__create_tramp, newthread, private_area, in pthread_create()
541 newthread->pt_stack.ss_sp, newthread->pt_stack.ss_size, in pthread_create()
542 flag, &newthread->pt_lid); in pthread_create()
545 pthread_mutex_lock(&newthread->pt_lock); in pthread_create()
547 pthread__reap(newthread); in pthread_create()
553 (void)pthread_setschedparam(newthread, p->ptap_policy, in pthread_create()
556 if ((newthread->pt_flags & PT_FLAG_SUSPENDED) == 0) { in pthread_create()
557 (void)_lwp_continue(newthread->pt_lid); in pthread_create()
561 *thread = newthread; in pthread_create()