module load priority

This patch adds the option to give a module a load priority. The value represents the order in which a module's load() function is initialized.  The lower the value, the higher the priority.  The value is only checked if the AST_MODFLAG_LOAD_ORDER flag is set.  If the AST_MODFLAG_LOAD_ORDER flag is not set, the value will never be read and the module will be given the lowest possible priority
on load.  Since some modules are reliant on a timing interface, the timing modules have been given a high load priorty.

(closes issue #15191)
Reported by: alecdavis
Tested by: dvossel

Review: https://reviewboard.asterisk.org/r/262/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
David Vossel
2009-06-09 16:22:04 +00:00
parent f3534a5a67
commit d532cbcd8a
5 changed files with 153 additions and 66 deletions

View File

@@ -189,6 +189,7 @@ struct ast_module_user_list;
enum ast_module_flags {
AST_MODFLAG_DEFAULT = 0,
AST_MODFLAG_GLOBAL_SYMBOLS = (1 << 0),
AST_MODFLAG_LOAD_ORDER = (1 << 1),
};
struct ast_module_info {
@@ -219,6 +220,13 @@ struct ast_module_info {
/*! The value of AST_BUILDOPT_SUM when this module was compiled */
const char buildopt_sum[33];
/*! This value represents the order in which a module's load() function is initialized.
* The lower this value, the higher the priority. The value is only checked if the
* AST_MODFLAG_LOAD_ORDER flag is set. If the AST_MODFLAG_LOAD_ORDER flag is not set,
* this value will never be read and the module will be given the lowest possible priority
* on load. */
unsigned char load_pri;
};
void ast_module_register(const struct ast_module_info *);