Lines Matching refs:sem
123 result = rt_sem_init(&cond->sem, cond_name, 0, RT_IPC_FLAG_FIFO); in pthread_cond_init()
130 rt_object_detach(&(cond->sem.parent.parent)); in pthread_cond_init()
131 cond->sem.parent.parent.type = RT_Object_Class_Semaphore; in pthread_cond_init()
174 if (!rt_list_isempty(&cond->sem.parent.suspend_thread)) in pthread_cond_destroy()
179 result = rt_sem_trytake(&(cond->sem)); in pthread_cond_destroy()
230 result = rt_sem_trytake(&(cond->sem)); in pthread_cond_broadcast()
234 rt_sem_release(&(cond->sem)); in pthread_cond_broadcast()
239 rt_sem_release(&(cond->sem)); in pthread_cond_broadcast()
288 if (rt_list_isempty(&cond->sem.parent.suspend_thread)) in pthread_cond_signal()
298 result = rt_sem_release(&(cond->sem)); in pthread_cond_signal()
343 rt_sem_t sem; in _pthread_cond_timedwait() local
346 sem = &(cond->sem); in _pthread_cond_timedwait()
347 if (sem == RT_NULL) in _pthread_cond_timedwait()
373 RT_ASSERT(sem != RT_NULL); in _pthread_cond_timedwait()
374 RT_ASSERT(rt_object_get_type(&sem->parent.parent) == RT_Object_Class_Semaphore); in _pthread_cond_timedwait()
378 if (sem->value > 0) in _pthread_cond_timedwait()
381 sem->value--; in _pthread_cond_timedwait()
410 rt_list_insert_before(&(sem->parent.suspend_thread), &RT_THREAD_LIST_NODE(thread)); in _pthread_cond_timedwait()