[asterisk-commits] kpfleming: trunk r49584 - in /trunk: ./
channels/chan_iax2.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Thu Jan 4 16:54:10 MST 2007
Author: kpfleming
Date: Thu Jan 4 17:54:09 2007
New Revision: 49584
URL: http://svn.digium.com/view/asterisk?view=rev&rev=49584
Log:
Merged revisions 49581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r49581 | kpfleming | 2007-01-04 17:50:15 -0600 (Thu, 04 Jan 2007) | 3 lines
create the IAX2 processing threads as background threads so they will use smaller stacks
when we create a dynamic thread, put it on the dynamic_list right away so we don't lose track of it
........
Modified:
trunk/ (props changed)
trunk/channels/chan_iax2.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=49584&r1=49583&r2=49584
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Thu Jan 4 17:54:09 2007
@@ -917,11 +917,15 @@
ast_cond_init(&thread->cond, NULL);
/* Create thread and send it on it's way */
- if (ast_pthread_create(&thread->threadid, NULL, iax2_process_thread, thread)) {
+ if (ast_pthread_create_background(&thread->threadid, NULL, iax2_process_thread, thread)) {
ast_cond_destroy(&thread->cond);
ast_mutex_destroy(&thread->lock);
free(thread);
thread = NULL;
+ } else {
+ AST_LIST_LOCK(&dynamic_list);
+ AST_LIST_INSERT_TAIL(&dynamic_list, thread, list);
+ AST_LIST_UNLOCK(&dynamic_list);
}
return thread;
@@ -8199,7 +8203,7 @@
thread->threadnum = ++threadcount;
ast_mutex_init(&thread->lock);
ast_cond_init(&thread->cond, NULL);
- if (ast_pthread_create(&thread->threadid, NULL, iax2_process_thread, thread)) {
+ if (ast_pthread_create_background(&thread->threadid, NULL, iax2_process_thread, thread)) {
ast_log(LOG_WARNING, "Failed to create new thread!\n");
free(thread);
thread = NULL;
More information about the asterisk-commits
mailing list