Lines Matching refs:attr
169 pthread_attr_t attr; in TEST() local
170 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
171 ASSERT_EQ(0, pthread_attr_setstack(&attr, stack, stack_size)); in TEST()
174 ASSERT_EQ(0, pthread_create(&t, &attr, DirtyKeyFn, &key)); in TEST()
237 pthread_attr_t attr; in AssertDetached() local
238 ASSERT_EQ(0, pthread_getattr_np(t, &attr)); in AssertDetached()
240 ASSERT_EQ(0, pthread_attr_getdetachstate(&attr, &detach_state)); in AssertDetached()
241 pthread_attr_destroy(&attr); in AssertDetached()
837 pthread_rwlockattr_t attr; in TEST() local
838 ASSERT_EQ(0, pthread_rwlockattr_init(&attr)); in TEST()
842 ASSERT_EQ(0, pthread_rwlockattr_setpshared(&attr, pshared_value_array[i])); in TEST()
844 ASSERT_EQ(0, pthread_rwlockattr_getpshared(&attr, &pshared)); in TEST()
851 ASSERT_EQ(0, pthread_rwlockattr_setkind_np(&attr, kind_array[i])); in TEST()
853 ASSERT_EQ(0, pthread_rwlockattr_getkind_np(&attr, &kind)); in TEST()
857 ASSERT_EQ(0, pthread_rwlockattr_destroy(&attr)); in TEST()
1277 pthread_rwlockattr_t attr; in InitRwlock() local
1278 ASSERT_EQ(0, pthread_rwlockattr_init(&attr)); in InitRwlock()
1279 ASSERT_EQ(0, pthread_rwlockattr_setkind_np(&attr, kind_type)); in InitRwlock()
1280 ASSERT_EQ(0, pthread_rwlock_init(&lock, &attr)); in InitRwlock()
1281 ASSERT_EQ(0, pthread_rwlockattr_destroy(&attr)); in InitRwlock()
1406 pthread_attr_t attr; in TEST() local
1407 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
1410 ASSERT_EQ(0, pthread_attr_getscope(&attr, &scope)); in TEST()
1415 pthread_condattr_t attr; in TEST() local
1416 pthread_condattr_init(&attr); in TEST()
1419 ASSERT_EQ(0, pthread_condattr_getclock(&attr, &clock)); in TEST()
1423 ASSERT_EQ(0, pthread_condattr_getpshared(&attr, &pshared)); in TEST()
1428 pthread_condattr_t attr; in TEST() local
1429 pthread_condattr_init(&attr); in TEST()
1431 ASSERT_EQ(0, pthread_condattr_setclock(&attr, CLOCK_REALTIME)); in TEST()
1433 ASSERT_EQ(0, pthread_condattr_getclock(&attr, &clock)); in TEST()
1436 ASSERT_EQ(0, pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)); in TEST()
1437 ASSERT_EQ(0, pthread_condattr_getclock(&attr, &clock)); in TEST()
1440 ASSERT_EQ(EINVAL, pthread_condattr_setclock(&attr, CLOCK_PROCESS_CPUTIME_ID)); in TEST()
1445 pthread_condattr_t attr; in TEST() local
1446 pthread_condattr_init(&attr); in TEST()
1448 ASSERT_EQ(0, pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)); in TEST()
1449 ASSERT_EQ(0, pthread_condattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)); in TEST()
1452 ASSERT_EQ(0, pthread_cond_init(&cond_var, &attr)); in TEST()
1457 attr = static_cast<pthread_condattr_t>(*reinterpret_cast<uint32_t*>(cond_var.__private)); in TEST()
1459 ASSERT_EQ(0, pthread_condattr_getclock(&attr, &clock)); in TEST()
1462 ASSERT_EQ(0, pthread_condattr_getpshared(&attr, &pshared)); in TEST()
1490 pthread_condattr_t attr; in InitCond() local
1491 ASSERT_EQ(0, pthread_condattr_init(&attr)); in InitCond()
1492 ASSERT_EQ(0, pthread_condattr_setclock(&attr, clock)); in InitCond()
1493 ASSERT_EQ(0, pthread_cond_init(&cond, &attr)); in InitCond()
1494 ASSERT_EQ(0, pthread_condattr_destroy(&attr)); in InitCond()
1636 pthread_condattr_t attr; in pthread_cond_timedwait_timeout_helper() local
1637 pthread_condattr_init(&attr); in pthread_cond_timedwait_timeout_helper()
1639 ASSERT_EQ(0, pthread_condattr_setclock(&attr, CLOCK_MONOTONIC)); in pthread_cond_timedwait_timeout_helper()
1641 ASSERT_EQ(0, pthread_condattr_getclock(&attr, &clock)); in pthread_cond_timedwait_timeout_helper()
1644 ASSERT_EQ(0, pthread_cond_init(&cond, &attr)); in pthread_cond_timedwait_timeout_helper()
1818 pthread_attr_t attr; in getstack_signal_handler() local
1819 ASSERT_EQ(0, pthread_getattr_np(pthread_self(), &attr)); in getstack_signal_handler()
1822 ASSERT_EQ(0, pthread_attr_getstack(&attr, &stack_base, &stack_size)); in getstack_signal_handler()
1825 ASSERT_LE(getstack_signal_handler_arg.signal_stack_base, &attr); in getstack_signal_handler()
1826 ASSERT_LT(static_cast<void*>(untag_address(&attr)), in getstack_signal_handler()
1858 pthread_attr_t attr; in TEST() local
1859 ASSERT_EQ(0, pthread_getattr_np(pthread_self(), &attr)); in TEST()
1862 ASSERT_EQ(0, pthread_attr_getstack(&attr, &main_stack_base, &main_stack_size)); in TEST()
1979 pthread_mutexattr_t attr; in TEST() local
1980 ASSERT_EQ(0, pthread_mutexattr_init(&attr)); in TEST()
1984 ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_NORMAL)); in TEST()
1985 ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type)); in TEST()
1988 ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK)); in TEST()
1989 ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type)); in TEST()
1992 ASSERT_EQ(0, pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE)); in TEST()
1993 ASSERT_EQ(0, pthread_mutexattr_gettype(&attr, &attr_type)); in TEST()
1996 ASSERT_EQ(0, pthread_mutexattr_destroy(&attr)); in TEST()
2000 pthread_mutexattr_t attr; in TEST() local
2001 ASSERT_EQ(0, pthread_mutexattr_init(&attr)); in TEST()
2004 ASSERT_EQ(0, pthread_mutexattr_getprotocol(&attr, &protocol)); in TEST()
2008 ASSERT_EQ(0, pthread_mutexattr_setprotocol(&attr, set_protocol)); in TEST()
2009 ASSERT_EQ(0, pthread_mutexattr_getprotocol(&attr, &protocol)); in TEST()
2028 pthread_mutexattr_t attr; in init() local
2029 ASSERT_EQ(0, pthread_mutexattr_init(&attr)); in init()
2030 ASSERT_EQ(0, pthread_mutexattr_settype(&attr, mutex_type)); in init()
2031 ASSERT_EQ(0, pthread_mutexattr_setprotocol(&attr, protocol)); in init()
2032 ASSERT_EQ(0, pthread_mutex_init(&lock, &attr)); in init()
2033 ASSERT_EQ(0, pthread_mutexattr_destroy(&attr)); in init()
2122 pthread_mutexattr_t attr; in TEST() local
2123 ASSERT_EQ(0, pthread_mutexattr_init(&attr)); in TEST()
2124 ASSERT_EQ(0, pthread_mutexattr_setprotocol(&attr, PTHREAD_PRIO_INHERIT)); in TEST()
2130 ASSERT_EQ(0, pthread_mutex_init(&m, &attr)); in TEST()
2133 ASSERT_EQ(ENOMEM, pthread_mutex_init(&m, &attr)); in TEST()
2144 ASSERT_EQ(0, pthread_mutexattr_destroy(&attr)); in TEST()
2648 pthread_barrierattr_t attr; in TEST() local
2649 ASSERT_EQ(0, pthread_barrierattr_init(&attr)); in TEST()
2651 ASSERT_EQ(0, pthread_barrierattr_getpshared(&attr, &pshared)); in TEST()
2653 ASSERT_EQ(0, pthread_barrierattr_setpshared(&attr, PTHREAD_PROCESS_SHARED)); in TEST()
2654 ASSERT_EQ(0, pthread_barrierattr_getpshared(&attr, &pshared)); in TEST()
2656 ASSERT_EQ(0, pthread_barrierattr_destroy(&attr)); in TEST()
2806 pthread_attr_t attr; in TEST() local
2807 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2810 ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)); in TEST()
2811 ASSERT_EQ(0, pthread_attr_getdetachstate(&attr, &state)); in TEST()
2814 ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE)); in TEST()
2815 ASSERT_EQ(0, pthread_attr_getdetachstate(&attr, &state)); in TEST()
2818 ASSERT_EQ(EINVAL, pthread_attr_setdetachstate(&attr, 123)); in TEST()
2819 ASSERT_EQ(0, pthread_attr_getdetachstate(&attr, &state)); in TEST()
2827 pthread_attr_t attr; in TEST() local
2828 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2829 ASSERT_EQ(0, pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED)); in TEST()
2849 int status = pthread_create(&t, &attr, IdFn, nullptr); in TEST()
2874 pthread_attr_t attr; in TEST() local
2875 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2878 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); in TEST()
2879 ASSERT_EQ(0, pthread_attr_getinheritsched(&attr, &state)); in TEST()
2882 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED)); in TEST()
2883 ASSERT_EQ(0, pthread_attr_getinheritsched(&attr, &state)); in TEST()
2886 ASSERT_EQ(EINVAL, pthread_attr_setinheritsched(&attr, 123)); in TEST()
2887 ASSERT_EQ(0, pthread_attr_getinheritsched(&attr, &state)); in TEST()
2892 pthread_attr_t attr; in TEST() local
2893 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2897 ASSERT_EQ(0, pthread_attr_setschedparam(&attr, ¶m)); in TEST()
2898 ASSERT_EQ(0, pthread_attr_setschedpolicy(&attr, SCHED_FIFO)); in TEST()
2899 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); in TEST()
2902 ASSERT_EQ(0, pthread_create(&t, &attr, IdFn, nullptr)); in TEST()
2907 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED)); in TEST()
2908 ASSERT_EQ(EINVAL, pthread_create(&t, &attr, IdFn, nullptr)); in TEST()
2921 pthread_attr_t attr; in TEST() local
2922 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2923 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); in TEST()
2927 ASSERT_EQ(0, pthread_create(&t, &attr, spin_helper.GetFunction(), nullptr)); in TEST()
2942 pthread_attr_t attr; in TEST() local
2943 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2944 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED)); in TEST()
2945 ASSERT_EQ(0, pthread_attr_setschedpolicy(&attr, SCHED_OTHER)); in TEST()
2949 ASSERT_EQ(0, pthread_create(&t, &attr, spin_helper.GetFunction(), nullptr)); in TEST()
2964 pthread_attr_t attr; in TEST() local
2965 ASSERT_EQ(0, pthread_attr_init(&attr)); in TEST()
2966 ASSERT_EQ(0, pthread_attr_setinheritsched(&attr, PTHREAD_INHERIT_SCHED)); in TEST()
2970 ASSERT_EQ(0, pthread_create(&t, &attr, spin_helper.GetFunction(), nullptr)); in TEST()