diff options
author | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-04 00:01:41 +0000 |
---|---|---|
committer | markster <markster@f38db490-d61c-443f-a65b-d21fe96a405b> | 2005-03-04 00:01:41 +0000 |
commit | c7e9fc09bb1adeb7ae5c8ab6841490ad69c97b1c (patch) | |
tree | ea321e7135ae9cf18dd1d716c1a1d03d1b6d006e /utils.c | |
parent | 5e71843a4f30df48110c356764cbf5c3b530df72 (diff) |
Make stack size be selectable
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@5132 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'utils.c')
-rwxr-xr-x | utils.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -389,14 +389,16 @@ int ast_utils_init(void) } -int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data) +int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data, size_t stacksize) { pthread_attr_t lattr; if (!attr) { pthread_attr_init(&lattr); attr = &lattr; } - errno = pthread_attr_setstacksize(attr, AST_STACKSIZE); + if (!stacksize) + stacksize = AST_STACKSIZE; + errno = pthread_attr_setstacksize(attr, stacksize); if (errno) ast_log(LOG_WARNING, "pthread_attr_setstacksize returned non-zero: %s\n", strerror(errno)); return pthread_create(thread, attr, start_routine, data); /* We're in ast_pthread_create, so it's okay */ |