[Asterisk-cvs] asterisk utils.c,1.32,1.33

markster at lists.digium.com markster at lists.digium.com
Thu Mar 3 18:04:29 CST 2005


Update of /usr/cvsroot/asterisk
In directory mongoose.digium.com:/tmp/cvs-serv15511

Modified Files:
	utils.c 
Log Message:
Make stack size be selectable


Index: utils.c
===================================================================
RCS file: /usr/cvsroot/asterisk/utils.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- utils.c	3 Mar 2005 16:27:28 -0000	1.32
+++ utils.c	4 Mar 2005 00:01:41 -0000	1.33
@@ -389,14 +389,16 @@
 }
 
 
-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 */




More information about the svn-commits mailing list