Lines Matching refs:pt

33 	struct lws_context_per_thread *pt;
70 pt = &context->pt[(int)wsi->tsi];
72 assert(wsi->position_in_fds_table < (int)pt->fds_count);
91 vpt = (volatile struct lws_context_per_thread *)pt;
118 lws_pt_lock(pt, __func__);
130 lws_pt_unlock(pt);
148 pfd = &pt->fds[wsi->position_in_fds_table];
203 sampled_tid = pt->service_tid;
222 * Enable or disable listen sockets on this pt globally...
223 * it's modulated according to the pt having space for a new accept.
227 struct lws_context_per_thread *pt, int allow)
249 __dump_fds(struct lws_context_per_thread *pt, const char *s)
253 lwsl_cx_warn(pt->context, "fds_count %u, %s", pt->fds_count, s);
255 for (n = 0; n < pt->fds_count; n++) {
256 struct lws *wsi = wsi_from_fd(pt->context, pt->fds[n].fd);
258 lwsl_cx_warn(pt->context, " %d: fd %d, wsi %s, pos_in_fds: %d",
259 n + 1, pt->fds[n].fd, lws_wsi_tag(wsi),
273 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
276 // __dump_fds(pt, "pre insert");
278 lws_pt_assert_lock_held(pt);
281 wsi->tsi, wsi->desc.sockfd, pt->fds_count);
283 if ((unsigned int)pt->fds_count >= context->fd_limit_per_thread) {
302 assert(wsi->event_pipe || wsi->a.vhost || wsi == pt->context->netlink);
318 pt->count_conns++;
319 wsi->position_in_fds_table = (int)pt->fds_count;
321 pt->fds[wsi->position_in_fds_table].fd = wsi->desc.sockfd;
322 pt->fds[wsi->position_in_fds_table].events = LWS_POLLIN;
324 pa.events = pt->fds[pt->fds_count].events;
339 if ((unsigned int)pt->fds_count == context->fd_limit_per_thread - 1)
340 lws_accept_modulation(context, pt, 0);
350 // __dump_fds(pt, "post insert");
355 /* requires pt lock */
364 struct lws_context_per_thread *pt = &context->pt[(int)wsi->tsi];
368 lws_pt_assert_lock_held(pt);
370 // __dump_fds(pt, "pre remove");
391 /* the guy who is to be deleted's slot index in pt->fds */
395 assert(m == LWS_NO_FDS_POS || (m >= 0 && (unsigned int)m < pt->fds_count));
403 pt->fds_count, pt->fds[pt->fds_count - 1].fd); */
408 assert(pt->fds_count && (unsigned int)m != pt->fds_count);
413 if ((unsigned int)m != pt->fds_count - 1) {
415 pt->fds[m] = pt->fds[pt->fds_count - 1];
419 pt->fds[pt->fds_count - 1].fd = -1;
421 /* this decrements pt->fds_count */
423 pt->count_conns--;
425 v = (int) pt->fds[m].fd;
431 "pt->fds_count=%d",
432 (int)pt->fds[m].fd, m,
433 pt->fds_count);
456 (unsigned int)pt->fds_count < context->fd_limit_per_thread - 1)
457 lws_accept_modulation(context, pt, 1);
467 // __dump_fds(pt, "post remove");
509 struct lws_context_per_thread *pt;
512 pt = &wsi->a.context->pt[(int)wsi->tsi];
514 lws_pt_lock(pt, __func__);
516 lws_pt_unlock(pt);