Lines Matching refs:attr
113 _thr_attr_destroy(pthread_attr_t *attr) in _thr_attr_destroy() argument
116 if (attr == NULL || *attr == NULL) in _thr_attr_destroy()
119 free((*attr)->cpuset); in _thr_attr_destroy()
120 free(*attr); in _thr_attr_destroy()
121 *attr = NULL; in _thr_attr_destroy()
164 *dst = pthread->attr; in _thr_attr_get_np()
184 _thr_attr_getdetachstate(const pthread_attr_t *attr, int *detachstate) in _thr_attr_getdetachstate() argument
187 if (attr == NULL || *attr == NULL || detachstate == NULL) in _thr_attr_getdetachstate()
190 if (((*attr)->flags & PTHREAD_DETACHED) != 0) in _thr_attr_getdetachstate()
201 _thr_attr_getguardsize(const pthread_attr_t * __restrict attr, in _thr_attr_getguardsize() argument
205 if (attr == NULL || *attr == NULL || guardsize == NULL) in _thr_attr_getguardsize()
208 *guardsize = (*attr)->guardsize_attr; in _thr_attr_getguardsize()
216 _thr_attr_getinheritsched(const pthread_attr_t * __restrict attr, in _thr_attr_getinheritsched() argument
220 if (attr == NULL || *attr == NULL) in _thr_attr_getinheritsched()
223 *sched_inherit = (*attr)->sched_inherit; in _thr_attr_getinheritsched()
231 _thr_attr_getschedparam(const pthread_attr_t * __restrict attr, in _thr_attr_getschedparam() argument
235 if (attr == NULL || *attr == NULL || param == NULL) in _thr_attr_getschedparam()
238 param->sched_priority = (*attr)->prio; in _thr_attr_getschedparam()
246 _thr_attr_getschedpolicy(const pthread_attr_t * __restrict attr, in _thr_attr_getschedpolicy() argument
250 if (attr == NULL || *attr == NULL || policy == NULL) in _thr_attr_getschedpolicy()
253 *policy = (*attr)->sched_policy; in _thr_attr_getschedpolicy()
261 _thr_attr_getscope(const pthread_attr_t * __restrict attr, in _thr_attr_getscope() argument
265 if (attr == NULL || *attr == NULL || contentionscope == NULL) in _thr_attr_getscope()
268 *contentionscope = ((*attr)->flags & PTHREAD_SCOPE_SYSTEM) != 0 ? in _thr_attr_getscope()
276 _pthread_attr_getstack(const pthread_attr_t * __restrict attr, in _pthread_attr_getstack() argument
280 if (attr == NULL || *attr == NULL || stackaddr == NULL || in _pthread_attr_getstack()
284 *stackaddr = (*attr)->stackaddr_attr; in _pthread_attr_getstack()
285 *stacksize = (*attr)->stacksize_attr; in _pthread_attr_getstack()
293 _thr_attr_getstackaddr(const pthread_attr_t *attr, void **stackaddr) in _thr_attr_getstackaddr() argument
296 if (attr == NULL || *attr == NULL || stackaddr == NULL) in _thr_attr_getstackaddr()
299 *stackaddr = (*attr)->stackaddr_attr; in _thr_attr_getstackaddr()
307 _thr_attr_getstacksize(const pthread_attr_t * __restrict attr, in _thr_attr_getstacksize() argument
311 if (attr == NULL || *attr == NULL || stacksize == NULL) in _thr_attr_getstacksize()
314 *stacksize = (*attr)->stacksize_attr; in _thr_attr_getstacksize()
322 _thr_attr_init(pthread_attr_t *attr) in _thr_attr_init() argument
332 *attr = pattr; in _thr_attr_init()
340 _pthread_attr_setcreatesuspend_np(pthread_attr_t *attr) in _pthread_attr_setcreatesuspend_np() argument
343 if (attr == NULL || *attr == NULL) in _pthread_attr_setcreatesuspend_np()
346 (*attr)->suspend = THR_CREATE_SUSPENDED; in _pthread_attr_setcreatesuspend_np()
354 _thr_attr_setdetachstate(pthread_attr_t *attr, int detachstate) in _thr_attr_setdetachstate() argument
357 if (attr == NULL || *attr == NULL || in _thr_attr_setdetachstate()
363 (*attr)->flags |= PTHREAD_DETACHED; in _thr_attr_setdetachstate()
365 (*attr)->flags &= ~PTHREAD_DETACHED; in _thr_attr_setdetachstate()
373 _thr_attr_setguardsize(pthread_attr_t *attr, size_t guardsize) in _thr_attr_setguardsize() argument
376 if (attr == NULL || *attr == NULL) in _thr_attr_setguardsize()
379 (*attr)->guardsize_attr = guardsize; in _thr_attr_setguardsize()
387 _thr_attr_setinheritsched(pthread_attr_t *attr, int sched_inherit) in _thr_attr_setinheritsched() argument
390 if (attr == NULL || *attr == NULL || in _thr_attr_setinheritsched()
395 (*attr)->sched_inherit = sched_inherit; in _thr_attr_setinheritsched()
403 _thr_attr_setschedparam(pthread_attr_t * __restrict attr, in _thr_attr_setschedparam() argument
408 if (attr == NULL || *attr == NULL || param == NULL) in _thr_attr_setschedparam()
411 policy = (*attr)->sched_policy; in _thr_attr_setschedparam()
425 (*attr)->prio = param->sched_priority; in _thr_attr_setschedparam()
434 _thr_attr_setschedpolicy(pthread_attr_t *attr, int policy) in _thr_attr_setschedpolicy() argument
437 if (attr == NULL || *attr == NULL || in _thr_attr_setschedpolicy()
441 (*attr)->sched_policy = policy; in _thr_attr_setschedpolicy()
442 (*attr)->prio = _thr_priorities[policy-1].pri_default; in _thr_attr_setschedpolicy()
450 _thr_attr_setscope(pthread_attr_t *attr, int contentionscope) in _thr_attr_setscope() argument
453 if (attr == NULL || *attr == NULL || in _thr_attr_setscope()
459 (*attr)->flags |= PTHREAD_SCOPE_SYSTEM; in _thr_attr_setscope()
461 (*attr)->flags &= ~PTHREAD_SCOPE_SYSTEM; in _thr_attr_setscope()
468 _pthread_attr_setstack(pthread_attr_t *attr, void *stackaddr, in _pthread_attr_setstack() argument
472 if (attr == NULL || *attr == NULL || stackaddr == NULL || in _pthread_attr_setstack()
476 (*attr)->stackaddr_attr = stackaddr; in _pthread_attr_setstack()
477 (*attr)->stacksize_attr = stacksize; in _pthread_attr_setstack()
485 _thr_attr_setstackaddr(pthread_attr_t *attr, void *stackaddr) in _thr_attr_setstackaddr() argument
488 if (attr == NULL || *attr == NULL || stackaddr == NULL) in _thr_attr_setstackaddr()
491 (*attr)->stackaddr_attr = stackaddr; in _thr_attr_setstackaddr()
499 _thr_attr_setstacksize(pthread_attr_t *attr, size_t stacksize) in _thr_attr_setstacksize() argument
502 if (attr == NULL || *attr == NULL || stacksize < PTHREAD_STACK_MIN) in _thr_attr_setstacksize()
505 (*attr)->stacksize_attr = stacksize; in _thr_attr_setstacksize()
534 pthread_attr_t attr; in _pthread_attr_setaffinity_np() local
537 if (pattr == NULL || (attr = (*pattr)) == NULL) in _pthread_attr_setaffinity_np()
541 if (attr->cpuset != NULL) { in _pthread_attr_setaffinity_np()
542 free(attr->cpuset); in _pthread_attr_setaffinity_np()
543 attr->cpuset = NULL; in _pthread_attr_setaffinity_np()
544 attr->cpusetsize = 0; in _pthread_attr_setaffinity_np()
561 if (attr->cpuset == NULL) { in _pthread_attr_setaffinity_np()
562 attr->cpuset = malloc(kern_size); in _pthread_attr_setaffinity_np()
563 if (attr->cpuset == NULL) in _pthread_attr_setaffinity_np()
565 attr->cpusetsize = kern_size; in _pthread_attr_setaffinity_np()
567 memcpy(attr->cpuset, cpusetp, kern_size); in _pthread_attr_setaffinity_np()
577 pthread_attr_t attr; in _pthread_attr_getaffinity_np() local
579 if (pattr == NULL || (attr = (*pattr)) == NULL) in _pthread_attr_getaffinity_np()
586 if (attr->cpuset != NULL) in _pthread_attr_getaffinity_np()
587 memcpy(cpusetp, attr->cpuset, MIN(cpusetsize, in _pthread_attr_getaffinity_np()
588 attr->cpusetsize)); in _pthread_attr_getaffinity_np()