Lines Matching refs:queue

103     if (osi_info.queue[index].state == OSI_FREE) {  in OSI_queue_allocate()
105 free_que = (tOSI_QUEUE_HANDLER)&osi_info.queue[index]; in OSI_queue_allocate()
107 if (osi_info.queue[index].name == NULL) continue; in OSI_queue_allocate()
109 if (strcmp((char const*)osi_info.queue[index].name, in OSI_queue_allocate()
123 memset(free_que->queue, 0, OSI_QUEUE_SIZE); in OSI_queue_allocate()
134 int OSI_queue_put(tOSI_QUEUE_HANDLER queue, void* p_data) { in OSI_queue_put() argument
139 if (!queue || queue->state != OSI_ALLOCATED) { in OSI_queue_put()
144 if (queue->head == queue->tail) { in OSI_queue_put()
147 queue->queue[queue->head++] = p_data; in OSI_queue_put()
148 if (queue->head >= OSI_QUEUE_SIZE) queue->head = 0; in OSI_queue_put()
151 pthread_cond_signal(&queue->cond); in OSI_queue_put()
154 ret = (queue->head) - (queue->tail); in OSI_queue_put()
163 void* queue_get(tOSI_QUEUE_HANDLER queue) { in queue_get() argument
166 if (!queue || queue->state != OSI_ALLOCATED) { in queue_get()
171 if (queue->tail + 1 >= OSI_QUEUE_SIZE) { in queue_get()
172 if (queue->head == 0) { in queue_get()
178 if (queue->tail + 1 == queue->head) { in queue_get()
185 queue->tail++; in queue_get()
186 if (queue->tail >= OSI_QUEUE_SIZE) queue->tail = 0; in queue_get()
187 data = queue->queue[queue->tail]; in queue_get()
192 void* OSI_queue_get(tOSI_QUEUE_HANDLER queue) { in OSI_queue_get() argument
196 data = queue_get(queue); in OSI_queue_get()
202 void* OSI_queue_get_wait(tOSI_QUEUE_HANDLER queue) { in OSI_queue_get_wait() argument
207 if (!queue || queue->state != OSI_ALLOCATED) { in OSI_queue_get_wait()
212 ret = queue_get(queue); in OSI_queue_get_wait()
214 pthread_cond_wait(&queue->cond, &osi_info.mutex); in OSI_queue_get_wait()
215 ret = queue_get(queue); in OSI_queue_get_wait()
231 tOSI_QUEUE_HANDLER queue = NULL; in OSI_queue_get_handler() local
238 if (osi_info.queue[index].name == NULL) continue; in OSI_queue_get_handler()
240 if (strcmp((char const*)osi_info.queue[index].name, (char const*)name) == in OSI_queue_get_handler()
242 queue = (tOSI_QUEUE_HANDLER)&osi_info.queue[index]; in OSI_queue_get_handler()
248 return queue; in OSI_queue_get_handler()