https://github.com/warmcat/libwebsockets/issues/730
LWS_VISIBLE LWS_EXTERN int
_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
{
- struct lws_context_per_thread *pt = &context->pt[tsi];
+ struct lws_context_per_thread *pt;
int n = -1, m, c;
char buf;
if (!context || !context->vhost_list)
return 1;
+ pt = &context->pt[tsi];
+
if (timeout_ms < 0)
goto faked_service;
LWS_VISIBLE LWS_EXTERN int
_lws_plat_service_tsi(struct lws_context *context, int timeout_ms, int tsi)
{
- struct lws_context_per_thread *pt = &context->pt[tsi];
+ struct lws_context_per_thread *pt;
WSANETWORKEVENTS networkevents;
struct lws_pollfd *pfd;
struct lws *wsi;
if (context == NULL)
return 1;
+ pt = &context->pt[tsi];
+
if (!context->service_tid_detected) {
struct lws _lws;