1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

smp: lws_wsi_tsi

This lets you find out the SMP Thread Service Index (tsi) that a wsi
is bound to.  This allows you to, eg, filter a global wsi list so
you can find the ones that exist in your service thread context.
This commit is contained in:
Andy Green 2020-10-01 10:30:00 +01:00
parent 398a2cd46c
commit c7c2db871d
2 changed files with 16 additions and 0 deletions

View file

@ -335,6 +335,15 @@ lws_get_library_version(void);
LWS_VISIBLE LWS_EXTERN void *
lws_wsi_user(struct lws *wsi);
/**
* lws_wsi_tsi() - get the service thread index the wsi is bound to
* \param wsi: lws connection
*
* Only useful is LWS_MAX_SMP > 1
*/
LWS_VISIBLE LWS_EXTERN int
lws_wsi_tsi(struct lws *wsi);
/**
* lws_set_wsi_user() - set the user data associated with the client connection
* \param wsi: lws connection

View file

@ -640,6 +640,13 @@ lws_wsi_user(struct lws *wsi)
return wsi->user_space;
}
int
lws_wsi_tsi(struct lws *wsi)
{
return wsi->tsi;
}
void
lws_set_wsi_user(struct lws *wsi, void *data)
{