Skip to content
Snippets Groups Projects
Commit a4222614 authored by Sean Bright's avatar Sean Bright
Browse files

utils.h: Set lower bound for thread stack size to PTHREAD_STACK_MIN

ASTERISK-28590 #close

Change-Id: I51abce00c04d0a06550bda5205580705185b9c1c
parent f4ecf3f5
No related branches found
No related tags found
No related merge requests found
......@@ -423,8 +423,13 @@ int ast_careful_fwrite(FILE *f, int fd, const char *s, size_t len, int timeoutms
* Thread management support (should be moved to lock.h or a different header)
*/
#define AST_STACKSIZE (((sizeof(void *) * 8 * 8) - 16) * 1024)
#define AST_STACKSIZE_LOW (((sizeof(void *) * 8 * 2) - 16) * 1024)
#if defined(PTHREAD_STACK_MIN)
# define AST_STACKSIZE MAX((((sizeof(void *) * 8 * 8) - 16) * 1024), PTHREAD_STACK_MIN)
# define AST_STACKSIZE_LOW MAX((((sizeof(void *) * 8 * 2) - 16) * 1024), PTHREAD_STACK_MIN)
#else
# define AST_STACKSIZE (((sizeof(void *) * 8 * 8) - 16) * 1024)
# define AST_STACKSIZE_LOW (((sizeof(void *) * 8 * 2) - 16) * 1024)
#endif
int ast_background_stacksize(void);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment