From d9d53395e22624b584e1babef669f25a37341a47 Mon Sep 17 00:00:00 2001 From: Andy Green Date: Thu, 26 Nov 2020 10:19:20 +0000 Subject: [PATCH] windows: threadpool: add back threadpool processing hook for CANCELLED --- lib/plat/windows/windows-service.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/plat/windows/windows-service.c b/lib/plat/windows/windows-service.c index ab81e9c34..69c664c86 100644 --- a/lib/plat/windows/windows-service.c +++ b/lib/plat/windows/windows-service.c @@ -193,6 +193,18 @@ _lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi) EnterCriticalSection(&pt->interrupt_lock); WSAResetEvent(pt->events[0]); LeaveCriticalSection(&pt->interrupt_lock); + +#if defined(LWS_WITH_THREADPOOL) + /* + * threadpools that need to call for on_writable callbacks do it by + * marking the task as needing one for its wsi, then cancelling service. + * + * Each tsi will call this to perform the actual callback_on_writable + * from the correct service thread context + */ + lws_threadpool_tsi_context(pt->context, pt->tid); +#endif + lws_broadcast(pt, LWS_CALLBACK_EVENT_WAIT_CANCELLED, NULL, 0); return 0;