mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
sequencer: cleanup on pt takedown
This commit is contained in:
parent
f12e116188
commit
71b7fd8597
3 changed files with 18 additions and 2 deletions
|
@ -1039,6 +1039,9 @@ lws_same_vh_protocol_insert(struct lws *wsi, int n);
|
|||
int
|
||||
lws_pt_do_pending_sequencer_events(struct lws_context_per_thread *pt);
|
||||
|
||||
void
|
||||
lws_sequencer_destroy_all_on_pt(struct lws_context_per_thread *pt);
|
||||
|
||||
LWS_EXTERN int
|
||||
lws_broadcast(struct lws_context *context, int reason, void *in, size_t len);
|
||||
|
||||
|
|
|
@ -127,6 +127,19 @@ lws_sequencer_destroy(lws_sequencer_t **pseq)
|
|||
lws_free_set_NULL(seq);
|
||||
}
|
||||
|
||||
void
|
||||
lws_sequencer_destroy_all_on_pt(struct lws_context_per_thread *pt)
|
||||
{
|
||||
lws_start_foreach_dll_safe(struct lws_dll2 *, p, tp,
|
||||
pt->seq_owner.head) {
|
||||
lws_sequencer_t *s = lws_container_of(p, lws_sequencer_t,
|
||||
seq_list);
|
||||
|
||||
lws_sequencer_destroy(&s);
|
||||
|
||||
} lws_end_foreach_dll_safe(p, tp);
|
||||
}
|
||||
|
||||
int
|
||||
lws_sequencer_event(lws_sequencer_t *seq, lws_seq_events_t e, void *data)
|
||||
{
|
||||
|
|
|
@ -550,9 +550,9 @@ lws_context_destroy3(struct lws_context *context)
|
|||
lwsl_debug("%s\n", __func__);
|
||||
|
||||
for (n = 0; n < context->count_threads; n++) {
|
||||
#if defined(LWS_ROLE_H1) || defined(LWS_ROLE_H2)
|
||||
struct lws_context_per_thread *pt = &context->pt[n];
|
||||
#endif
|
||||
|
||||
lws_sequencer_destroy_all_on_pt(pt);
|
||||
|
||||
if (context->event_loop_ops->destroy_pt)
|
||||
context->event_loop_ops->destroy_pt(context, n);
|
||||
|
|
Loading…
Add table
Reference in a new issue