Lines Matching refs:attr
90 if (__predict_true((thread->attr.flags & PTHREAD_ATTR_FLAG_DETACHED) == 0)) {
97 if (thread->attr.sched_policy != SCHED_NORMAL) {
99 param.sched_priority = thread->attr.sched_priority;
100 if (sched_setscheduler(thread->tid, thread->attr.sched_policy, ¶m) == -1) {
142 static int __allocate_thread(pthread_attr_t* attr, pthread_internal_t** threadp, void** child_stack) {
146 if (attr->stack_base == NULL) {
149 mmap_size = BIONIC_ALIGN(attr->stack_size + sizeof(pthread_internal_t), PAGE_SIZE);
150 attr->guard_size = BIONIC_ALIGN(attr->guard_size, PAGE_SIZE);
151 attr->stack_base = __create_thread_mapped_space(mmap_size, attr->guard_size);
152 if (attr->stack_base == NULL) {
155 stack_top = reinterpret_cast<uint8_t*>(attr->stack_base) + mmap_size;
159 stack_top = reinterpret_cast<uint8_t*>(attr->stack_base) + attr->stack_size;
176 attr->stack_size = stack_top - reinterpret_cast<uint8_t*>(attr->stack_base);
179 thread->attr = *attr;
211 int pthread_create(pthread_t* thread_out, pthread_attr_t const* attr,
219 if (attr == NULL) {
222 thread_attr = *attr;
223 attr = NULL; // Prevent misuse below.
265 munmap(thread->attr.stack_base, thread->mmap_size);