Lines Matching refs:sem
18 sem_t *sem = (sem_t *)p1; in child_func() local
20 zassert_equal(sem_post(sem), 0, "sem_post failed"); in child_func()
24 static void semaphore_test(sem_t *sem) in semaphore_test() argument
33 zassert_equal(sem_init(sem, 0, (CONFIG_POSIX_SEM_VALUE_MAX + 1)), -1, in semaphore_test()
37 zassert_equal(sem_init(sem, 0, 0), 0, "sem_init failed"); in semaphore_test()
40 zassert_equal(sem_getvalue(sem, &val), 0); in semaphore_test()
46 zassert_equal(sem_trywait(sem), -1); in semaphore_test()
49 ret = pthread_create(&thread1, NULL, child_func, sem); in semaphore_test()
59 zassert_equal(sem_timedwait(sem, &abstime), 0); in semaphore_test()
64 zassert_equal(sem_timedwait(sem, &abstime), -1); in semaphore_test()
67 zassert_equal(sem_destroy(sem), 0, "semaphore is not destroyed"); in semaphore_test()
70 zassert_equal(sem_init(sem, 0, 1), 0, "sem_init failed"); in semaphore_test()
71 zassert_equal(sem_getvalue(sem, &val), 0); in semaphore_test()
74 zassert_equal(sem_destroy(sem), -1, in semaphore_test()
80 zassert_equal(sem_trywait(sem), 0); in semaphore_test()
82 zassert_equal(pthread_create(&thread2, NULL, child_func, sem), 0, "Thread creation failed"); in semaphore_test()
85 zassert_equal(sem_wait(sem), 0, "sem_wait failed"); in semaphore_test()
111 int nsem_get_ref_count(sem_t *sem);
130 sem_t *sem = (sem_t *)p; in nsem_close_func() local
136 zassert_ok(sem_close(sem)); in nsem_close_func()
141 zassert_ok(sem_close(sem)); in nsem_close_func()