Lines Matching refs:queue

38 wsi_queue_init(struct wsi_queue *queue, int length)  in wsi_queue_init()  argument
46 ret = u_vector_init(&queue->vector, sizeof(uint32_t), in wsi_queue_init()
60 ret = pthread_cond_init(&queue->cond, &condattr); in wsi_queue_init()
64 ret = pthread_mutex_init(&queue->mutex, NULL); in wsi_queue_init()
72 pthread_cond_destroy(&queue->cond); in wsi_queue_init()
76 u_vector_finish(&queue->vector); in wsi_queue_init()
82 wsi_queue_destroy(struct wsi_queue *queue) in wsi_queue_destroy() argument
84 u_vector_finish(&queue->vector); in wsi_queue_destroy()
85 pthread_mutex_destroy(&queue->mutex); in wsi_queue_destroy()
86 pthread_cond_destroy(&queue->cond); in wsi_queue_destroy()
90 wsi_queue_push(struct wsi_queue *queue, uint32_t index) in wsi_queue_push() argument
94 pthread_mutex_lock(&queue->mutex); in wsi_queue_push()
96 if (u_vector_length(&queue->vector) == 0) in wsi_queue_push()
97 pthread_cond_signal(&queue->cond); in wsi_queue_push()
99 elem = u_vector_add(&queue->vector); in wsi_queue_push()
102 pthread_mutex_unlock(&queue->mutex); in wsi_queue_push()
109 wsi_queue_pull(struct wsi_queue *queue, uint32_t *index, uint64_t timeout) in wsi_queue_pull() argument
114 pthread_mutex_lock(&queue->mutex); in wsi_queue_pull()
131 while (u_vector_length(&queue->vector) == 0) { in wsi_queue_pull()
132 ret = pthread_cond_timedwait(&queue->cond, &queue->mutex, &abstime); in wsi_queue_pull()
145 uint32_t *elem = u_vector_remove(&queue->vector); in wsi_queue_pull()
150 pthread_mutex_unlock(&queue->mutex); in wsi_queue_pull()