From 398a2cd46c8d6b2b61c3f0a91818d2739c64b7cf Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 1 Oct 2020 10:39:43 +0100 Subject: [PATCH] smp: set tsi in fakewsi used with WAIT_CANCELLED Together with the new lws_wsi_tsi(wsi) this lets the WAIT_CANCELLED callback understand its tsi context, the broadcasts are done for each pt / loop. --- lib/core-net/wsi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c index ba14b759c..58c8e2bc6 100644 --- a/lib/core-net/wsi.c +++ b/lib/core-net/wsi.c @@ -610,8 +610,10 @@ lws_broadcast(struct lws_context_per_thread *pt, int reason, void *in, size_t le lws_fakewsi_def_plwsa(pt); int n, ret = 0; - lws_fakewsi_prep_plwsa_ctx(pt->context); +#if !defined(LWS_PLAT_FREERTOS) && LWS_MAX_SMP > 1 + ((struct lws *)plwsa)->tsi = (int)(pt - &pt->context->pt[0]); +#endif while (v) { const struct lws_protocols *p = v->protocols;