summaryrefslogtreecommitdiff
path: root/channels/chan_sip.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2010-12-20 17:15:54 +0000
committerRussell Bryant <russell@russellbryant.com>2010-12-20 17:15:54 +0000
commitcc0b7e7df540e5833c79c9b12ef880f03a74b922 (patch)
treed1049b4c6e02a7236e3a64c09f10633b99decc64 /channels/chan_sip.c
parentcf655aa1c9acabad60dcd9febd952de136b9838d (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_sip.c')
-rw-r--r--channels/chan_sip.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 691514ddc..c292d448a 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -782,7 +782,7 @@ static pthread_t monitor_thread = AST_PTHREADT_NULL;
static int sip_reloading = FALSE; /*!< Flag for avoiding multiple reloads at the same time */
static enum channelreloadreason sip_reloadreason; /*!< Reason for last reload/load of configuration */
-struct sched_context *sched; /*!< The scheduling context */
+struct ast_sched_context *sched; /*!< The scheduling context */
static struct io_context *io; /*!< The IO context */
static int *sipsock_read_id; /*!< ID of IO entry for sipsock FD */
struct sip_pkt;
@@ -28901,14 +28901,14 @@ static int load_module(void)
ASTOBJ_CONTAINER_INIT(&regl); /* Registry object list -- not searched for anything */
ASTOBJ_CONTAINER_INIT(&submwil); /* MWI subscription object list */
- if (!(sched = sched_context_create())) {
+ if (!(sched = ast_sched_context_create())) {
ast_log(LOG_ERROR, "Unable to create scheduler context\n");
return AST_MODULE_LOAD_FAILURE;
}
if (!(io = io_context_create())) {
ast_log(LOG_ERROR, "Unable to create I/O context\n");
- sched_context_destroy(sched);
+ ast_sched_context_destroy(sched);
return AST_MODULE_LOAD_FAILURE;
}
@@ -28930,7 +28930,7 @@ static int load_module(void)
if (ast_channel_register(&sip_tech)) {
ast_log(LOG_ERROR, "Unable to register channel type 'SIP'\n");
io_context_destroy(io);
- sched_context_destroy(sched);
+ ast_sched_context_destroy(sched);
return AST_MODULE_LOAD_FAILURE;
}
@@ -29151,7 +29151,7 @@ static int unload_module(void)
clear_sip_domains();
ast_free_ha(sip_cfg.contact_ha);
close(sipsock);
- sched_context_destroy(sched);
+ ast_sched_context_destroy(sched);
con = ast_context_find(used_context);
if (con) {
ast_context_destroy(con, "SIP");