diff options
author | Russell Bryant <russell@russellbryant.com> | 2010-12-20 17:15:54 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2010-12-20 17:15:54 +0000 |
commit | cc0b7e7df540e5833c79c9b12ef880f03a74b922 (patch) | |
tree | d1049b4c6e02a7236e3a64c09f10633b99decc64 /channels/chan_mgcp.c | |
parent | cf655aa1c9acabad60dcd9febd952de136b9838d (diff) |
Some scheduler API cleanup and improvements.
Previously, I had added the ast_sched_thread stuff that was a generic scheduler
thread implementation. However, if you used it, it required using different
functions for modifying scheduler contents. This patch reworks how this is
done and just allows you to optionally start a thread on the original scheduler
context structure that has always been there. This makes it trivial to switch
to the generic scheduler thread implementation without having to touch any of
the other code that adds or removes scheduler entries.
In passing, I made some naming tweaks to add ast_ prefixes where they were not
there before.
Review: https://reviewboard.asterisk.org/r/1007/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels/chan_mgcp.c')
-rw-r--r-- | channels/chan_mgcp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c index 499b5e55e..723849785 100644 --- a/channels/chan_mgcp.c +++ b/channels/chan_mgcp.c @@ -231,7 +231,7 @@ static int ourport; static int mgcpdebug = 0; -static struct sched_context *sched; +static struct ast_sched_context *sched; static struct io_context *io; /*! The private structures of the mgcp channels are linked for * selecting outgoing channels @@ -4776,14 +4776,14 @@ static int reload_config(int reload) /*! \brief load_module: PBX load module - initialization ---*/ static int load_module(void) { - if (!(sched = sched_context_create())) { + if (!(sched = ast_sched_context_create())) { ast_log(LOG_WARNING, "Unable to create schedule context\n"); return AST_MODULE_LOAD_FAILURE; } if (!(io = io_context_create())) { ast_log(LOG_WARNING, "Unable to create I/O context\n"); - sched_context_destroy(sched); + ast_sched_context_destroy(sched); return AST_MODULE_LOAD_FAILURE; } @@ -4794,7 +4794,7 @@ static int load_module(void) if (ast_channel_register(&mgcp_tech)) { ast_log(LOG_ERROR, "Unable to register channel class 'MGCP'\n"); io_context_destroy(io); - sched_context_destroy(sched); + ast_sched_context_destroy(sched); return AST_MODULE_LOAD_FAILURE; } @@ -4905,7 +4905,7 @@ static int unload_module(void) close(mgcpsock); ast_rtp_glue_unregister(&mgcp_rtp_glue); ast_cli_unregister_multiple(cli_mgcp, sizeof(cli_mgcp) / sizeof(struct ast_cli_entry)); - sched_context_destroy(sched); + ast_sched_context_destroy(sched); return 0; } |