[asterisk-commits] tilghman: branch 1.6.2 r296950 - /branches/1.6.2/channels/chan_iax2.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Nov 30 19:38:23 CST 2010
Author: tilghman
Date: Tue Nov 30 19:38:19 2010
New Revision: 296950
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=296950
Log:
Missed initializations caused startup errors on Mac OS X (and possibly others, too).
Modified:
branches/1.6.2/channels/chan_iax2.c
Modified: branches/1.6.2/channels/chan_iax2.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.6.2/channels/chan_iax2.c?view=diff&rev=296950&r1=296949&r2=296950
==============================================================================
--- branches/1.6.2/channels/chan_iax2.c (original)
+++ branches/1.6.2/channels/chan_iax2.c Tue Nov 30 19:38:19 2010
@@ -1341,6 +1341,9 @@
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;
}
@@ -11757,10 +11760,17 @@
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);
More information about the asterisk-commits
mailing list