Lines Matching refs:mutex

317   pthread_mutex_t mutex;  member
322 ASSERT_EQ(0, pthread_mutex_init(&data.mutex, nullptr)); in main()
323 ASSERT_EQ(0, pthread_mutex_lock(&data.mutex)); in main()
329 ASSERT_EQ(0, pthread_mutex_lock(&data.mutex)); in main()
330 ASSERT_EQ(0, pthread_mutex_unlock(&data.mutex)); in main()
344 pthread_mutex_unlock(&data->mutex); in thread_fn()
1471 pthread_mutex_t mutex; member in pthread_CondWakeupTest
1482 std::function<int (pthread_cond_t* cond, pthread_mutex_t* mutex)> wait_function;
1486 ASSERT_EQ(0, pthread_mutex_init(&mutex, nullptr)); in SetUp()
1498 std::function<int(pthread_cond_t* cond, pthread_mutex_t* mutex)> wait_function) { in StartWaitingThread()
1511 std::function<int(pthread_cond_t* cond, pthread_mutex_t* mutex, const timespec* timeout)> in RunTimedTest() argument
1517 StartWaitingThread([&wait_function, &ts](pthread_cond_t* cond, pthread_mutex_t* mutex) { in RunTimedTest() argument
1518 return wait_function(cond, mutex, &ts); in RunTimedTest()
1525 void RunTimedTest(clockid_t clock, std::function<int(pthread_cond_t* cond, pthread_mutex_t* mutex, in RunTimedTest() argument
1528 RunTimedTest(clock, [clock, &wait_function](pthread_cond_t* cond, pthread_mutex_t* mutex, in RunTimedTest()
1530 return wait_function(cond, mutex, clock, timeout); in RunTimedTest()
1538 ASSERT_EQ(0, pthread_mutex_destroy(&mutex)); in TearDown()
1543 ASSERT_EQ(0, pthread_mutex_lock(&test->mutex)); in WaitThreadFn()
1546 ASSERT_EQ(0, test->wait_function(&test->cond, &test->mutex)); in WaitThreadFn()
1550 ASSERT_EQ(0, pthread_mutex_unlock(&test->mutex)); in WaitThreadFn()
1556 StartWaitingThread([](pthread_cond_t* cond, pthread_mutex_t* mutex) { in TEST_F() argument
1557 return pthread_cond_wait(cond, mutex); in TEST_F()
1565 StartWaitingThread([](pthread_cond_t* cond, pthread_mutex_t* mutex) { in TEST_F() argument
1566 return pthread_cond_wait(cond, mutex); in TEST_F()
1631 pthread_mutex_t mutex; in pthread_cond_timedwait_timeout_helper() local
1632 ASSERT_EQ(0, pthread_mutex_init(&mutex, nullptr)); in pthread_cond_timedwait_timeout_helper()
1648 ASSERT_EQ(0, pthread_mutex_lock(&mutex)); in pthread_cond_timedwait_timeout_helper()
1652 ASSERT_EQ(ETIMEDOUT, wait_function(&cond, &mutex, &ts)); in pthread_cond_timedwait_timeout_helper()
1654 ASSERT_EQ(EINVAL, wait_function(&cond, &mutex, &ts)); in pthread_cond_timedwait_timeout_helper()
1656 ASSERT_EQ(EINVAL, wait_function(&cond, &mutex, &ts)); in pthread_cond_timedwait_timeout_helper()
1659 ASSERT_EQ(ETIMEDOUT, wait_function(&cond, &mutex, &ts)); in pthread_cond_timedwait_timeout_helper()
1660 ASSERT_EQ(0, pthread_mutex_unlock(&mutex)); in pthread_cond_timedwait_timeout_helper()
1706 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; in TEST() local
1708 EXPECT_EQ(EINVAL, pthread_cond_clockwait(&cond, &mutex, CLOCK_PROCESS_CPUTIME_ID, &ts)); in TEST()
2043 static int UnlockFromAnotherThread(pthread_mutex_t* mutex) { in UnlockFromAnotherThread() argument
2046 pthread_mutex_t* mutex = static_cast<pthread_mutex_t*>(mutex_voidp); in UnlockFromAnotherThread() local
2047 intptr_t result = pthread_mutex_unlock(mutex); in UnlockFromAnotherThread()
2049 }, mutex); in UnlockFromAnotherThread()
2463 pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER; in TEST() local
2465 EXPECT_EQ(EINVAL, pthread_mutex_clocklock(&mutex, CLOCK_PROCESS_CPUTIME_ID, &ts)); in TEST()
2530 pthread_mutex_t* mutex = reinterpret_cast<pthread_mutex_t*>( in TEST() local
2532 ASSERT_EQ(0, pthread_mutex_init(mutex, nullptr)); in TEST()
2533 ASSERT_EQ(0, pthread_mutex_lock(mutex)); in TEST()
2534 ASSERT_EQ(0, pthread_mutex_unlock(mutex)); in TEST()
2535 ASSERT_EQ(0, pthread_mutex_destroy(mutex)); in TEST()