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 /main/channel.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 'main/channel.c')
-rw-r--r-- | main/channel.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/main/channel.c b/main/channel.c index 0e5b72308..723d60ef6 100644 --- a/main/channel.c +++ b/main/channel.c @@ -1103,7 +1103,7 @@ __ast_channel_alloc_ap(int needqueue, int state, const char *cid_num, const char tmp->epfd = epoll_create(25); #endif - if (!(tmp->sched = sched_context_create())) { + if (!(tmp->sched = ast_sched_context_create())) { ast_log(LOG_WARNING, "Channel allocation failed: Unable to create schedule context\n"); return ast_channel_unref(tmp); } @@ -2339,8 +2339,9 @@ static void ast_channel_destructor(void *obj) ast_free(chan->tech_pvt); } - if (chan->sched) - sched_context_destroy(chan->sched); + if (chan->sched) { + ast_sched_context_destroy(chan->sched); + } if (chan->name) { char *dashptr; @@ -2710,7 +2711,7 @@ int ast_hangup(struct ast_channel *chan) chan->vstream = NULL; } if (chan->sched) { - sched_context_destroy(chan->sched); + ast_sched_context_destroy(chan->sched); chan->sched = NULL; } |