38 struct lws_threadpool;
39 struct lws_threadpool_task;
41 enum lws_threadpool_task_status {
43 LWS_TP_STATUS_RUNNING,
44 LWS_TP_STATUS_SYNCING,
45 LWS_TP_STATUS_STOPPING,
46 LWS_TP_STATUS_FINISHED,
47 LWS_TP_STATUS_STOPPED,
50 enum lws_threadpool_task_return {
52 LWS_TP_RETURN_CHECKING_IN,
60 LWS_TP_RETURN_FINISHED,
62 LWS_TP_RETURN_STOPPED,
65 LWS_TP_RETURN_FLAG_OUTLIVE = 64
74 #if defined(LWS_WITH_SECURE_STREAMS)
75 struct lws_ss_handle *ss;
84 enum lws_threadpool_task_return (*
task)(
void *
user,
85 enum lws_threadpool_task_status s);
112 LWS_VISIBLE LWS_EXTERN
struct lws_threadpool *
113 lws_threadpool_create(
struct lws_context *context,
115 const char *format, ...) LWS_FORMAT(3);
131 LWS_VISIBLE LWS_EXTERN
void
132 lws_threadpool_finish(struct lws_threadpool *tp);
141 LWS_VISIBLE LWS_EXTERN
void
142 lws_threadpool_destroy(struct lws_threadpool *tp);
164 LWS_VISIBLE LWS_EXTERN struct lws_threadpool_task *
165 lws_threadpool_enqueue(struct lws_threadpool *tp,
167 const
char *format, ...) LWS_FORMAT(3);
186 LWS_VISIBLE LWS_EXTERN
int
187 lws_threadpool_dequeue(struct lws *wsi) LWS_WARN_DEPRECATED;
189 LWS_VISIBLE LWS_EXTERN
int
190 lws_threadpool_dequeue_task(struct lws_threadpool_task *task);
214 LWS_VISIBLE LWS_EXTERN enum lws_threadpool_task_status
215 lws_threadpool_task_status_wsi(struct lws *wsi,
216 struct lws_threadpool_task **task,
void **user)
219 LWS_VISIBLE LWS_EXTERN enum lws_threadpool_task_status
220 lws_threadpool_task_status(struct lws_threadpool_task *task,
void **user);
222 LWS_VISIBLE LWS_EXTERN enum lws_threadpool_task_status
223 lws_threadpool_task_status_noreap(struct lws_threadpool_task *task);
237 LWS_VISIBLE LWS_EXTERN
void
238 lws_threadpool_task_sync(struct lws_threadpool_task *task,
int stop);
254 LWS_VISIBLE LWS_EXTERN
void
255 lws_threadpool_dump(struct lws_threadpool *tp);
259 LWS_VISIBLE LWS_EXTERN struct lws_threadpool_task *
260 lws_threadpool_get_task_wsi(struct lws *wsi);
262 #if defined(LWS_WITH_SECURE_STREAMS)
263 LWS_VISIBLE LWS_EXTERN
struct lws_threadpool_task *
264 lws_threadpool_get_task_ss(
struct lws_ss_handle *ss);
268 LWS_VISIBLE LWS_EXTERN
int
269 lws_threadpool_foreach_task_wsi(
struct lws *wsi,
void *user,
270 int (*cb)(
struct lws_threadpool_task *task,
273 #if defined(LWS_WITH_SECURE_STREAMS)
274 LWS_VISIBLE LWS_EXTERN
int
275 lws_threadpool_foreach_task_ss(
struct lws_ss_handle *ss,
void *user,
276 int (*cb)(
struct lws_threadpool_task *task,
void *user));
Definition: lws-threadpool.h:68
Definition: lws-threadpool.h:73
void * user
Definition: lws-threadpool.h:79
const char * name
Definition: lws-threadpool.h:80
struct lws * wsi
Definition: lws-threadpool.h:77
enum lws_threadpool_task_return(* task)(void *user, enum lws_threadpool_task_status s)
Definition: lws-threadpool.h:84
char async_task
Definition: lws-threadpool.h:81
void(* cleanup)(struct lws *wsi, void *user)
Definition: lws-threadpool.h:87