Lines Matching refs:vhd

51 struct vhd {
93 struct vhd *vhd = (struct vhd *)d;
97 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++)
98 if (pthread_equal(pthread_self(), vhd->pthread_spam[n]))
103 if (!vhd->pss_list)
106 pthread_mutex_lock(&vhd->lock_ring); /* --------- ring lock { */
109 n = (int)lws_ring_get_count_free_elements(vhd->ring);
123 n = (int)lws_ring_insert(vhd->ring, &amsg, 1);
132 lws_cancel_service(vhd->context);
135 pthread_mutex_unlock(&vhd->lock_ring); /* } ring lock ------- */
141 } while (!vhd->finished);
156 struct vhd *vhd = (struct vhd *)lws_protocol_vh_priv_get(
170 vhd = lws_protocol_vh_priv_zalloc(lws_get_vhost(wsi),
171 lws_get_protocol(wsi), sizeof(struct vhd));
172 vhd->context = lws_get_context(wsi);
173 vhd->protocol = lws_get_protocol(wsi);
174 vhd->vhost = lws_get_vhost(wsi);
176 vhd->ring = lws_ring_create(sizeof(struct msg), 8,
178 if (!vhd->ring)
181 pthread_mutex_init(&vhd->lock_ring, NULL);
185 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++)
186 if (pthread_create(&vhd->pthread_spam[n], NULL,
187 thread_spam, vhd)) {
196 vhd->finished = 1;
197 for (n = 0; n < (int)LWS_ARRAY_SIZE(vhd->pthread_spam); n++)
198 pthread_join(vhd->pthread_spam[n], &retval);
200 if (vhd->ring)
201 lws_ring_destroy(vhd->ring);
203 pthread_mutex_destroy(&vhd->lock_ring);
228 /* add ourselves to the list of live pss held in the vhd */
230 lws_ll_fwd_insert(pss, pss_list, vhd->pss_list);
231 pss->tail = lws_ring_get_oldest_tail(vhd->ring);
252 lws_ll_fwd_remove(struct pss, pss_list, pss, vhd->pss_list);
261 pmsg = lws_ring_get_element(vhd->ring, &pss->tail);
274 vhd->ring, /* lws_ring object */
278 vhd->pss_list, /* head of list of objects with tails */
283 if (lws_ring_get_element(vhd->ring, &pss->tail))
290 if (!vhd)
296 lws_start_foreach_llp(struct pss **, ppss, vhd->pss_list) {