@@ -206,6 +206,11 @@ struct mg_callbacks {
ctx: context handle */
void (*init_context)(const struct mg_context *ctx);
+ /* Called when a new worker thread is initialized.
+ Parameters:
+ ctx: context handle */
+ void(*init_thread)(const struct mg_context *ctx);
+
/* Called when civetweb context is deleted.
Parameters:
@@ -12291,6 +12291,10 @@ worker_thread_run(void *thread_func_param)
uint32_t addr;
#endif
+ if (ctx->callbacks.init_thread) {
+ ctx->callbacks.init_thread(ctx);
+ }
mg_set_thread_name("worker");
tls.is_master = 0;