*
* Called whenever a new thread is created.
*
+ * @param[in] mod_cs Module instance's configuration section.
* @param[in] instance data, specific to an instantiated module.
* Pre-allocated, and populated during the
* bootstrap and instantiate calls.
+ * @param[in] el The event list serviced by this thread.
* @param[in] thread data specific to this module instance.
* @return
* - 0 on success.
* - -1 if instantiation failed.
*/
-typedef int (*module_thread_t)(fr_event_list_t *el, void *instance, void *thread);
+typedef int (*module_thread_t)(CONF_SECTION const *mod_cs, void *instance, fr_event_list_t *el, void *thread);
/** Module thread destruction callback
*
rbtree_insert(thread_inst_ctx->tree, thread_inst);
}
- ret = inst->module->thread_instantiate(thread_inst_ctx->el, inst, thread_inst->data);
+ ret = inst->module->thread_instantiate(inst->cs, inst, thread_inst_ctx->el, thread_inst->data);
if (ret < 0) {
ERROR("Thread instantiation failed for module \"%s\"", inst->name);
return -1;
/** Called when the delay is complete, and we're running from the interpreter
*
*/
-static rlm_rcode_t delay_return(UNUSED REQUEST *request, UNUSED void *module_instance, UNUSED void *ctx)
+static rlm_rcode_t delay_return(UNUSED REQUEST *request, UNUSED void *instance, UNUSED void *ctx)
{
return RLM_MODULE_OK;
}
* Marks the request as resumable, and prints the actual delay time.
*
* @param[in] request The current request.
- * @param[in] module_instance This instance of the delay module.
+ * @param[in] instance This instance of the delay module.
* @param[in] ctx Scheduled end of the delay.
* @param[in] fired When request processing was resumed.
*/
-static void delay_done(REQUEST *request, UNUSED void *module_instance, void *ctx, struct timeval *fired)
+static void delay_done(REQUEST *request, UNUSED void *instance, void *ctx, struct timeval *fired)
{
struct timeval *when = talloc_get_type_abort(ctx, struct timeval);
return 1;
}
-static int mod_thread_instantiate(UNUSED void *instance, void *thread)
+static int mod_thread_instantiate(UNUSED CONF_SECTION const *cs, UNUSED void *instance, UNUSED fr_event_list_t *el,
+ void *thread)
{
rlm_test_thread_t *t = thread;
t->value = pthread_self();
- INFO("Performing instantiation for thread %p", (void *)t->value);
+ INFO("Performing instantiation for thread %p (ctx %p)", (void *)t->value, t);
return 0;
}