Lines Matching refs:pt
59 lws_glib_set_idle(struct lws_context_per_thread *pt) in lws_glib_set_idle() argument
63 if (pt->glib.idle_tag) in lws_glib_set_idle()
70 g_source_set_callback(gis, lws_glib_idle_timer_cb, pt, NULL); in lws_glib_set_idle()
71 pt->glib.idle_tag = g_source_attach(gis, pt_to_g_main_context(pt)); in lws_glib_set_idle()
77 lws_glib_set_timeout(struct lws_context_per_thread *pt, unsigned int ms) in lws_glib_set_timeout() argument
85 g_source_set_callback(gts, lws_glib_hrtimer_cb, pt, NULL); in lws_glib_set_timeout()
86 pt->glib.hrtimer_tag = g_source_attach(gts, pt_to_g_main_context(pt)); in lws_glib_set_timeout()
96 struct lws_context_per_thread *pt; in lws_glib_dispatch() local
120 pt = &sub->wsi->context->pt[(int)sub->wsi->tsi]; in lws_glib_dispatch()
121 if (pt->is_destroyed) in lws_glib_dispatch()
126 if (!pt->glib.idle_tag) in lws_glib_dispatch()
127 lws_glib_set_idle(pt); in lws_glib_dispatch()
129 if (pt->destroy_self) in lws_glib_dispatch()
130 lws_context_destroy(pt->context); in lws_glib_dispatch()
151 struct lws_context_per_thread *pt = (struct lws_context_per_thread *)p; in lws_glib_hrtimer_cb() local
155 lws_pt_lock(pt, __func__); in lws_glib_hrtimer_cb()
156 us = __lws_sul_service_ripe(&pt->pt_sul_owner, lws_now_usecs()); in lws_glib_hrtimer_cb()
162 lws_glib_set_timeout(pt, ms); in lws_glib_hrtimer_cb()
165 lws_pt_unlock(pt); in lws_glib_hrtimer_cb()
167 lws_glib_set_idle(pt); in lws_glib_hrtimer_cb()
175 struct lws_context_per_thread *pt = (struct lws_context_per_thread *)p; in lws_glib_idle_timer_cb() local
177 if (pt->is_destroyed) in lws_glib_idle_timer_cb()
180 lws_service_do_ripe_rxflow(pt); in lws_glib_idle_timer_cb()
181 lws_glib_hrtimer_cb(pt); in lws_glib_idle_timer_cb()
186 if (!lws_service_adjust_timeout(pt->context, 1, pt->tid)) { in lws_glib_idle_timer_cb()
188 _lws_plat_service_forced_tsi(pt->context, pt->tid); in lws_glib_idle_timer_cb()
190 if (!lws_service_adjust_timeout(pt->context, 1, pt->tid)) in lws_glib_idle_timer_cb()
194 if (pt->destroy_self) in lws_glib_idle_timer_cb()
195 lws_context_destroy(pt->context); in lws_glib_idle_timer_cb()
204 pt->glib.idle_tag = 0; in lws_glib_idle_timer_cb()
212 struct lws_context_per_thread *pt = ctx; in lws_glib_sigint_cb() local
214 pt->inside_service = 1; in lws_glib_sigint_cb()
216 if (pt->context->eventlib_signal_cb) { in lws_glib_sigint_cb()
217 pt->context->eventlib_signal_cb(NULL, 0); in lws_glib_sigint_cb()
221 if (!pt->event_loop_foreign) in lws_glib_sigint_cb()
222 g_main_loop_quit(pt_to_loop(pt)); in lws_glib_sigint_cb()
234 context->pt[n].w_sigint.context = context; in elops_init_context_glib()
242 struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; in elops_accept_glib() local
268 g_source_attach(wsi_to_gsource(wsi), pt_to_g_main_context(pt)); in elops_accept_glib()
276 struct lws_context_per_thread *pt = &context->pt[tsi]; in elops_init_pt_glib() local
283 context->pt[tsi].event_loop_foreign = 1; in elops_init_pt_glib()
291 pt->glib.loop = loop; in elops_init_pt_glib()
305 lws_glib_set_idle(pt); in elops_init_pt_glib()
309 if (pt->event_loop_foreign) in elops_init_pt_glib()
312 pt->glib.sigint_tag = g_unix_signal_add(SIGINT, in elops_init_pt_glib()
313 G_SOURCE_FUNC(lws_glib_sigint_cb), pt); in elops_init_pt_glib()
325 struct lws_context_per_thread *pt = &wsi->context->pt[(int)wsi->tsi]; in elops_io_glib() local
328 if (!pt_to_loop(pt) || wsi->context->being_destroyed || pt->is_destroyed) in elops_io_glib()
362 struct lws_context_per_thread *pt = &context->pt[tsi]; in elops_run_pt_glib() local
364 if (pt_to_loop(pt)) in elops_run_pt_glib()
365 g_main_loop_run(pt_to_loop(pt)); in elops_run_pt_glib()
371 struct lws_context_per_thread *pt; in elops_destroy_wsi_glib() local
376 pt = &wsi->context->pt[(int)wsi->tsi]; in elops_destroy_wsi_glib()
377 if (pt->is_destroyed) in elops_destroy_wsi_glib()
396 struct lws_context_per_thread *pt = &context->pt[tsi]; in elops_destroy_pt_glib() local
399 if (!pt_to_loop(pt)) in elops_destroy_pt_glib()
412 if (pt->glib.hrtimer_tag) in elops_destroy_pt_glib()
413 g_source_remove(pt->glib.hrtimer_tag); in elops_destroy_pt_glib()
415 if (!pt->event_loop_foreign) { in elops_destroy_pt_glib()
416 g_main_loop_quit(pt_to_loop(pt)); in elops_destroy_pt_glib()
417 g_source_remove(pt->glib.sigint_tag); in elops_destroy_pt_glib()
418 g_main_loop_unref(pt_to_loop(pt)); in elops_destroy_pt_glib()
421 pt_to_loop(pt) = NULL; in elops_destroy_pt_glib()
427 struct lws_context_per_thread *pt = &context->pt[0]; in elops_destroy_context2_glib() local
431 if (!pt->event_loop_foreign) in elops_destroy_context2_glib()
432 g_main_loop_quit(pt_to_loop(pt)); in elops_destroy_context2_glib()
433 pt++; in elops_destroy_context2_glib()