Lines Matching defs:ring
47 pthread_mutex_t lock_ring; /* serialize access to the ring buffer */
48 struct lws_ring *ring; /* {lock_ring} ringbuffer holding unsent content */
97 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */
100 n = (int)lws_ring_get_count_free_elements(vhd->ring);
115 n = (int)lws_ring_insert(vhd->ring, &amsg, 1);
127 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */
183 vhd->ring = lws_ring_create(sizeof(struct msg), 8,
185 if (!vhd->ring) {
186 lwsl_err("%s: failed to create ring\n", __func__);
208 if (vhd->ring)
209 lws_ring_destroy(vhd->ring);
217 pss->tail = lws_ring_get_oldest_tail(vhd->ring);
228 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */
230 pmsg = lws_ring_get_element(vhd->ring, &pss->tail);
232 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */
240 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */
246 vhd->ring, /* lws_ring object */
256 if (lws_ring_get_element(vhd->ring, &pss->tail))
260 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */