#include <freeradius-devel/util/dlist.h>
#include <freeradius-devel/util/rbtree.h>
#include <freeradius-devel/util/syserror.h>
+#include <freeradius-devel/server/cf_parse.h>
#include <pthread.h>
return 0;
}
+static const CONF_PARSER schedule_config[] = {
+ { FR_CONF_OFFSET("stats_interval", FR_TYPE_TIME_DELTA, fr_schedule_t, stats_interval), },
+
+ CONF_PARSER_TERMINATOR
+};
+
/** Create a scheduler and spawn the child threads.
*
* @param[in] ctx talloc context.
unsigned int i;
fr_schedule_worker_t *sw, *next;
fr_schedule_t *sc;
+ CONF_SECTION *subcs;
/*
* Single-threaded mode MUST have event list, and zero
sc->log = logger;
sc->lvl = lvl;
+ /*
+ * Parse any scheduler-specific configuration.
+ */
+ subcs = cf_section_find(cs, "scheduler", NULL);
+ if (subcs) {
+ cf_section_rule_push(subcs, schedule_config);
+ if (cf_section_parse(sc, sc, subcs) < 0) {
+ talloc_free(sc);
+ fr_strerror_printf("Failed parsing scheduler configuration");
+ return NULL;
+ }
+ }
+
sc->worker_thread_instantiate = worker_thread_instantiate;
sc->running = true;
* Parent thread-specific data from the single_worker
*/
if (sc->worker_thread_instantiate) {
- CONF_SECTION *subcs;
-
subcs = cf_section_find(sc->cs, "worker", "0");
if (!subcs) subcs = cf_section_find(sc->cs, "worker", NULL);