From b9a34d86349acf094707444ae70f98951c1efb9d Mon Sep 17 00:00:00 2001 From: Mark Spencer <markster@digium.com> Date: Thu, 3 Mar 2005 16:18:44 +0000 Subject: [PATCH] Fix stack size (take 2) (bug #3706) git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5126 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk/utils.h | 11 ++--------- utils.c | 3 --- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/include/asterisk/utils.h b/include/asterisk/utils.h index 25f7e06f41..c09aa6e2d2 100755 --- a/include/asterisk/utils.h +++ b/include/asterisk/utils.h @@ -160,19 +160,12 @@ struct ast_realloca { #endif #define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__ -#define AST_STACK_SIZE 128 * 1024 +#define AST_STACKSIZE 128 * 1024 #ifdef __linux__ -#define ast_pthread_create pthread_create #define ast_strcasestr strcasestr #else -/* Linux threads have a default 2MB stack size. */ -#ifndef PTHREAD_ATTR_STACKSIZE -#define PTHREAD_ATTR_STACKSIZE 2097152 -#endif /* PTHREAD_ATTR_STACKSIZE */ -extern int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data); extern char *ast_strcasestr(const char *, const char *); #endif /* __linux__ */ - - +extern int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data); #endif diff --git a/utils.c b/utils.c index aa23541085..6267bbbb7a 100755 --- a/utils.c +++ b/utils.c @@ -389,8 +389,6 @@ int ast_utils_init(void) } -#ifndef __linux__ -#undef pthread_create /* For ast_pthread_create function only */ int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data) { pthread_attr_t lattr; @@ -403,7 +401,6 @@ int ast_pthread_create(pthread_t *thread, pthread_attr_t *attr, void *(*start_ro 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 */ } -#endif /* ! LINUX */ /* Case-insensitive substring matching */ #ifndef LINUX -- GitLab