diff options
author | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-04 19:47:22 +0000 |
---|---|---|
committer | kpfleming <kpfleming@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-10-04 19:47:22 +0000 |
commit | ac1ade7444c3a81d76e879f6d3571aae3c8e7bae (patch) | |
tree | ec12e69e00eece03476c2cb0feca8bc2b7be859b /pbx | |
parent | c75c68f35a55aa7107e5096bde5dc4d2f0cd4a07 (diff) |
update thread creation code a bit
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space
add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@44378 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'pbx')
-rw-r--r-- | pbx/pbx_dundi.c | 4 | ||||
-rw-r--r-- | pbx/pbx_spool.c | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/pbx/pbx_dundi.c b/pbx/pbx_dundi.c index 5d62c641d..99295826e 100644 --- a/pbx/pbx_dundi.c +++ b/pbx/pbx_dundi.c @@ -2123,8 +2123,8 @@ static void *process_precache(void *ign) static int start_network_thread(void) { - ast_pthread_create(&netthreadid, NULL, network_thread, NULL); - ast_pthread_create(&precachethreadid, NULL, process_precache, NULL); + ast_pthread_create_background(&netthreadid, NULL, network_thread, NULL); + ast_pthread_create_background(&precachethreadid, NULL, process_precache, NULL); return 0; } diff --git a/pbx/pbx_spool.c b/pbx/pbx_spool.c index c4714a09d..ec008280b 100644 --- a/pbx/pbx_spool.c +++ b/pbx/pbx_spool.c @@ -495,7 +495,7 @@ static int load_module(void) snprintf(qdonedir, sizeof(qdir), "%s/%s", ast_config_AST_SPOOL_DIR, "outgoing_done"); pthread_attr_init(&attr); pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); - if ((ret = ast_pthread_create(&thread,&attr,scan_thread, NULL)) != 0) { + if ((ret = ast_pthread_create_background(&thread,&attr,scan_thread, NULL)) != 0) { ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret); return -1; } |