diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-04 23:54:09 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2007-01-04 23:54:09 +0000 |
commit | a08d12f459955bce58ac0a3c477053e0a2340a15 (patch) | |
tree | c23db4afee4514abbebc00c604b7aaff9c1205c6 /channels/chan_iax2.c | |
parent | 5e1bd58600a68709af39f6472720423a53a4d8f7 (diff) |
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
........
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@49584 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r-- | channels/chan_iax2.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c index 4d6a4970f..74a6e2c24 100644 --- a/channels/chan_iax2.c +++ b/channels/chan_iax2.c @@ -917,11 +917,15 @@ static struct iax2_thread *find_idle_thread(void) 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 @@ static int start_network_thread(void) 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; |