![]() |
The FreeRADIUS server $Id: 15bac2a4c627c01d1aa2047687b3418955ac7f00 $
|
Scheduler communication. More...
#include <freeradius-devel/io/channel.h>#include <freeradius-devel/io/network.h>#include <freeradius-devel/io/worker.h>#include <freeradius-devel/util/log.h>
Include dependency graph for schedule.h:Go to the source code of this file.
Data Structures | |
| struct | fr_schedule_config_t |
Typedefs | |
| typedef struct fr_schedule_s | fr_schedule_t |
| typedef void(* | fr_schedule_thread_detach_t) (void *uctx) |
| Explicitly free resources allocated by fr_schedule_thread_instantiate_t. | |
| typedef int(* | fr_schedule_thread_instantiate_t) (TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx) |
| Setup a new thread. | |
Functions | |
| fr_schedule_t * | fr_schedule_create (TALLOC_CTX *ctx, fr_event_list_t *el, fr_log_t *log, fr_log_lvl_t lvl, fr_schedule_thread_instantiate_t worker_thread_instantiate, fr_schedule_thread_detach_t worked_thread_detach, fr_schedule_config_t *config)) |
| Create a scheduler and spawn the child threads. | |
| int | fr_schedule_destroy (fr_schedule_t **sc) |
| Destroy a scheduler, and tell its child threads to exit. | |
| fr_network_t * | fr_schedule_directory_add (fr_schedule_t *sc, fr_listen_t *li) |
| Add a directory NOTE_EXTEND to a scheduler. | |
| fr_network_t * | fr_schedule_listen_add (fr_schedule_t *sc, fr_listen_t *li) |
| Add a fr_listen_t to a scheduler. | |
| int | fr_schedule_pthread_create (pthread_t *thread, void *(*func)(void *), void *arg) |
| Creates a new thread using our standard set of options. | |
| int | fr_schedule_worker_id (void) |
| Return the worker id for the current thread. | |
Scheduler communication.
Definition in file schedule.h.
| struct fr_schedule_config_t |
Definition at line 63 of file schedule.h.
Collaboration diagram for fr_schedule_config_t:| Data Fields | ||
|---|---|---|
| uint32_t | max_networks | number of network threads |
| uint32_t | max_workers | number of network threads |
| fr_network_config_t | network | configuration for each network; |
| fr_time_delta_t | stats_interval | print channel statistics |
| fr_worker_config_t | worker | configuration for each worker |
| typedef struct fr_schedule_s fr_schedule_t |
Definition at line 32 of file schedule.h.
| typedef void(* fr_schedule_thread_detach_t) (void *uctx) |
Explicitly free resources allocated by fr_schedule_thread_instantiate_t.
| [in] | uctx | User data passed to callback. |
Definition at line 61 of file schedule.h.
| typedef int(* fr_schedule_thread_instantiate_t) (TALLOC_CTX *ctx, fr_event_list_t *el, void *uctx) |
Setup a new thread.
| [in] | ctx | to allocate any thread specific memory in. |
| [in] | el | Event list used by the thread. |
| [in] | uctx | User data passed to callback. |
Definition at line 55 of file schedule.h.
| fr_schedule_t * fr_schedule_create | ( | TALLOC_CTX * | ctx, |
| fr_event_list_t * | el, | ||
| fr_log_t * | logger, | ||
| fr_log_lvl_t | lvl, | ||
| fr_schedule_thread_instantiate_t | worker_thread_instantiate, | ||
| fr_schedule_thread_detach_t | worker_thread_detach, | ||
| fr_schedule_config_t * | config | ||
| ) |
Create a scheduler and spawn the child threads.
| [in] | ctx | talloc context. |
| [in] | el | event list, only for single-threaded mode. |
| [in] | logger | destination for all logging messages. |
| [in] | lvl | log level. |
| [in] | worker_thread_instantiate | callback for new worker threads. |
| [in] | worker_thread_detach | callback to destroy resources allocated by worker_thread_instantiate. |
| [in] | config | configuration for the scheduler |
Definition at line 466 of file schedule.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_schedule_destroy | ( | fr_schedule_t ** | sc_to_free | ) |
Destroy a scheduler, and tell its child threads to exit.
| [in] | sc_to_free | the scheduler |
Definition at line 768 of file schedule.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_network_t * fr_schedule_directory_add | ( | fr_schedule_t * | sc, |
| fr_listen_t * | li | ||
| ) |
Add a directory NOTE_EXTEND to a scheduler.
| [in] | sc | the scheduler |
| [in] | li | the ctx and callbacks for the transport. |
Definition at line 924 of file schedule.c.
Here is the call graph for this function:
Here is the caller graph for this function:| fr_network_t * fr_schedule_listen_add | ( | fr_schedule_t * | sc, |
| fr_listen_t * | li | ||
| ) |
Add a fr_listen_t to a scheduler.
| [in] | sc | the scheduler |
| [in] | li | the ctx and callbacks for the transport. |
Definition at line 892 of file schedule.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_schedule_pthread_create | ( | pthread_t * | thread, |
| void *(*)(void *) | func, | ||
| void * | arg | ||
| ) |
Creates a new thread using our standard set of options.
New threads are:
| [out] | thread | handled that was created by pthread_create. |
| [in] | func | entry point for the thread. |
| [in] | arg | Argument to pass to func. |
Definition at line 428 of file schedule.c.
Here is the call graph for this function:
Here is the caller graph for this function:| int fr_schedule_worker_id | ( | void | ) |
Return the worker id for the current thread.
Definition at line 157 of file schedule.c.
Here is the caller graph for this function:
1.9.8