* Called before calling kqueue to put the thread in a sleeping state.
*
* @param[in] now The current time.
- * @param[in] ctx User ctx passed to #fr_event_list_create.
+ * @param[in] ctx User ctx passed to #fr_event_list_alloc.
*/
typedef int (*fr_event_status_t)(void *ctx, struct timeval *now);
bool fr_event_loop_exiting(fr_event_list_t *el);
int fr_event_loop(fr_event_list_t *el);
-fr_event_list_t *fr_event_list_create(TALLOC_CTX *ctx, fr_event_status_t status, void *status_ctx);
+fr_event_list_t *fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_t status, void *status_ctx);
#ifdef __cplusplus
}
return NULL;
}
- nr->el = fr_event_list_create(nr, fr_network_idle, nr);
+ nr->el = fr_event_list_alloc(nr, fr_network_idle, nr);
if (!nr->el) {
fr_strerror_printf("Failed creating event list: %s", fr_strerror());
talloc_free(nr);
worker->message_set_size = 1024;
worker->ring_buffer_size = (1 << 16);
- worker->el = fr_event_list_create(worker, fr_worker_idle, worker);
+ worker->el = fr_event_list_alloc(worker, fr_worker_idle, worker);
if (!worker->el) {
fr_strerror_printf("Failed creating event list: %s", fr_strerror());
talloc_free(worker);
* - A pointer to a new event list on success (free with talloc_free).
* - NULL on error.
*/
-fr_event_list_t *fr_event_list_create(TALLOC_CTX *ctx, fr_event_status_t status, void *status_ctx)
+fr_event_list_t *fr_event_list_alloc(TALLOC_CTX *ctx, fr_event_status_t status, void *status_ctx)
{
fr_event_list_t *el;
struct kevent kev;
struct timeval now, when;
fr_event_list_t *el;
- el = fr_event_list_create(NULL, NULL);
+ el = fr_event_list_alloc(NULL, NULL);
if (!el) exit(1);
memset(&rand_pool, 0, sizeof(rand_pool));
*/
int radius_event_init(TALLOC_CTX *ctx)
{
- el = fr_event_list_create(ctx, event_status, NULL);
+ el = fr_event_list_alloc(ctx, event_status, NULL);
if (!el) return 0;
#ifdef HAVE_SYSTEMD_WATCHDOG
char *buff;
- events = fr_event_list_create(conf, _rs_event_status, NULL);
+ events = fr_event_list_alloc(conf, _rs_event_status, NULL);
if (!events) {
ERROR();
goto finish;
ctx = talloc_init("thread");
- el = fr_event_list_create(ctx, NULL, NULL);
+ el = fr_event_list_alloc(ctx, NULL, NULL);
rad_assert(el != NULL);
local_backlog = fr_heap_create(timestamp_cmp, offsetof(REQUEST, heap_id));
/*
* Create a dummy event list
*/
- el = fr_event_list_create(NULL, NULL, NULL);
+ el = fr_event_list_alloc(NULL, NULL, NULL);
rad_assert(el != NULL);
/*
return 0;
}
- session->el = fr_event_list_create(session, NULL, NULL);
+ session->el = fr_event_list_alloc(session, NULL, NULL);
if (!session->el) {
ERROR("Failed creating event list");
close_pipes: