Lines Matching refs:semaphore

27 	struct cv2_sem *semaphore;  in osSemaphoreNew()  local
38 (void **)&semaphore, K_MSEC(100)) == 0) { in osSemaphoreNew()
39 (void)memset(semaphore, 0, sizeof(struct cv2_sem)); in osSemaphoreNew()
44 k_sem_init(&semaphore->z_semaphore, initial_count, max_count); in osSemaphoreNew()
47 strncpy(semaphore->name, init_sema_attrs.name, in osSemaphoreNew()
48 sizeof(semaphore->name) - 1); in osSemaphoreNew()
50 strncpy(semaphore->name, attr->name, in osSemaphoreNew()
51 sizeof(semaphore->name) - 1); in osSemaphoreNew()
54 return (osSemaphoreId_t)semaphore; in osSemaphoreNew()
62 struct cv2_sem *semaphore = (struct cv2_sem *) semaphore_id; in osSemaphoreAcquire() local
75 status = k_sem_take(&semaphore->z_semaphore, K_FOREVER); in osSemaphoreAcquire()
77 status = k_sem_take(&semaphore->z_semaphore, K_NO_WAIT); in osSemaphoreAcquire()
79 status = k_sem_take(&semaphore->z_semaphore, in osSemaphoreAcquire()
94 struct cv2_sem *semaphore = (struct cv2_sem *)semaphore_id; in osSemaphoreGetCount() local
100 return k_sem_count_get(&semaphore->z_semaphore); in osSemaphoreGetCount()
108 struct cv2_sem *semaphore = (struct cv2_sem *) semaphore_id; in osSemaphoreRelease() local
115 if (k_sem_count_get(&semaphore->z_semaphore) == in osSemaphoreRelease()
116 semaphore->z_semaphore.limit) { in osSemaphoreRelease()
120 k_sem_give(&semaphore->z_semaphore); in osSemaphoreRelease()
130 struct cv2_sem *semaphore = (struct cv2_sem *)semaphore_id; in osSemaphoreDelete() local
145 k_mem_slab_free(&cv2_semaphore_slab, (void *)semaphore); in osSemaphoreDelete()
152 struct cv2_sem *semaphore = (struct cv2_sem *)semaphore_id; in osSemaphoreGetName() local
155 return semaphore->name; in osSemaphoreGetName()