aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-01 01:46:32 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-01 01:46:32 +0000
commit45a06641f4dec228f98ee377394469dd14795b0a (patch)
tree1f51e70158871cc515a37737e8fe6cdfcf5e472a /channels
parente951726f02e29593a505c676313171894c7f607d (diff)
Merged revisions 296950 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r296950 | tilghman | 2010-11-30 19:38:19 -0600 (Tue, 30 Nov 2010) | 2 lines Missed initializations caused startup errors on Mac OS X (and possibly others, too). ........ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.8@296951 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 813d17794..58df35303 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1438,6 +1438,9 @@ static struct iax2_thread *find_idle_thread(void)
if (ast_pthread_create_background(&thread->threadid, NULL, iax2_process_thread, thread)) {
ast_cond_destroy(&thread->cond);
ast_mutex_destroy(&thread->lock);
+ ast_mutex_unlock(&thread->init_lock);
+ ast_cond_destroy(&thread->init_cond);
+ ast_mutex_destroy(&thread->init_lock);
ast_free(thread);
return NULL;
}
@@ -12090,10 +12093,17 @@ static int start_network_thread(void)
thread->threadnum = ++threadcount;
ast_mutex_init(&thread->lock);
ast_cond_init(&thread->cond, NULL);
+ ast_mutex_init(&thread->init_lock);
+ ast_cond_init(&thread->init_cond, NULL);
if (ast_pthread_create_background(&thread->threadid, NULL, iax2_process_thread, thread)) {
ast_log(LOG_WARNING, "Failed to create new thread!\n");
+ ast_mutex_destroy(&thread->lock);
+ ast_cond_destroy(&thread->cond);
+ ast_mutex_destroy(&thread->init_lock);
+ ast_cond_destroy(&thread->init_cond);
ast_free(thread);
thread = NULL;
+ continue;
}
AST_LIST_LOCK(&idle_list);
AST_LIST_INSERT_TAIL(&idle_list, thread, list);