[Asterisk-cvs] asterisk/channels chan_alsa.c,1.25,1.26 chan_h323.c,1.71,1.72 chan_iax.c,1.64,1.65 chan_iax2.c,1.176,1.177 chan_mgcp.c,1.72,1.73 chan_modem.c,1.25,1.26 chan_oss.c,1.29,1.30 chan_phone.c,1.32,1.33 chan_sip.c,1.467,1.468 chan_skinny.c,1.52,1.53 chan_vofr.c,1.18,1.19 chan_vpb.c,1.32,1.33 chan_zap.c,1.320,1.321

markster at lists.digium.com markster at lists.digium.com
Sun Aug 8 13:29:03 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv18773/channels

Modified Files:
	chan_alsa.c chan_h323.c chan_iax.c chan_iax2.c chan_mgcp.c 
	chan_modem.c chan_oss.c chan_phone.c chan_sip.c chan_skinny.c 
	chan_vofr.c chan_vpb.c chan_zap.c 
Log Message:
Merge BSD stack size work (bug #2067)


Index: chan_alsa.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_alsa.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- chan_alsa.c	27 Jul 2004 02:46:24 -0000	1.25
+++ chan_alsa.c	8 Aug 2004 17:15:02 -0000	1.26
@@ -18,6 +18,7 @@
 #include <asterisk/pbx.h>
 #include <asterisk/config.h>
 #include <asterisk/cli.h>
+#include <asterisk/utils.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -1032,7 +1033,7 @@
 	}
 	for (x=0;x<sizeof(myclis)/sizeof(struct ast_cli_entry); x++)
 		ast_cli_register(myclis + x);
-	pthread_create(&sthread, NULL, sound_thread, NULL);
+	ast_pthread_create(&sthread, NULL, sound_thread, NULL);
 #ifdef ALSA_MONITOR
 	if (alsa_monitor_start()) {
 		ast_log(LOG_ERROR, "Problem starting Monitoring\n");

Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -d -r1.71 -r1.72
--- chan_h323.c	30 Jul 2004 20:01:58 -0000	1.71
+++ chan_h323.c	8 Aug 2004 17:15:02 -0000	1.72
@@ -1441,7 +1441,7 @@
 		pthread_kill(monitor_thread, SIGURG);
 	} else {
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;

Index: chan_iax.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax.c,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -d -r1.64 -r1.65
--- chan_iax.c	16 Jul 2004 04:40:54 -0000	1.64
+++ chan_iax.c	8 Aug 2004 17:15:02 -0000	1.65
@@ -4548,7 +4548,7 @@
 
 static int start_network_thread(void)
 {
-	return pthread_create(&netthreadid, NULL, network_thread, NULL);
+	return ast_pthread_create(&netthreadid, NULL, network_thread, NULL);
 }
 
 static struct iax_context *build_context(char *context)

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.176
retrieving revision 1.177
diff -u -d -r1.176 -r1.177
--- chan_iax2.c	7 Aug 2004 19:16:53 -0000	1.176
+++ chan_iax2.c	8 Aug 2004 17:15:02 -0000	1.177
@@ -4729,7 +4729,7 @@
 		strncpy(dpr->callednum, callednum, sizeof(dpr->callednum) - 1);
 		if (callerid)
 			dpr->callerid = strdup(callerid);
-		if (pthread_create(&newthread, NULL, dp_lookup_thread, dpr)) {
+		if (ast_pthread_create(&newthread, NULL, dp_lookup_thread, dpr)) {
 			ast_log(LOG_WARNING, "Unable to start lookup thread!\n");
 		}
 	} else
@@ -4807,7 +4807,7 @@
 		memset(d, 0, sizeof(*d));
 		d->chan1 = chan1m;
 		d->chan2 = chan2m;
-		if (!pthread_create(&th, NULL, iax_park_thread, d))
+		if (!ast_pthread_create(&th, NULL, iax_park_thread, d))
 			return 0;
 		free(d);
 	}
@@ -6164,7 +6164,7 @@
 
 static int start_network_thread(void)
 {
-	return pthread_create(&netthreadid, NULL, network_thread, NULL);
+	return ast_pthread_create(&netthreadid, NULL, network_thread, NULL);
 }
 
 static struct iax2_context *build_context(char *context)

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- chan_mgcp.c	5 Aug 2004 21:36:33 -0000	1.72
+++ chan_mgcp.c	8 Aug 2004 17:15:02 -0000	1.73
@@ -2798,7 +2798,7 @@
                 }
                 c = mgcp_new(sub, AST_STATE_DOWN);
                 if (c) {
-                    if (pthread_create(&t, &attr, mgcp_ss, c)) {
+                    if (ast_pthread_create(&t, &attr, mgcp_ss, c)) {
                         ast_log(LOG_WARNING, "Unable to create switch thread: %s\n", strerror(errno));
                         ast_hangup(c);
                     }
@@ -3325,7 +3325,7 @@
 		pthread_kill(monitor_thread, SIGURG);
 	} else {
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;

Index: chan_modem.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_modem.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- chan_modem.c	16 Jul 2004 04:40:54 -0000	1.25
+++ chan_modem.c	8 Aug 2004 17:15:02 -0000	1.26
@@ -22,6 +22,7 @@
 #include <asterisk/pbx.h>
 #include <asterisk/options.h>
 #include <asterisk/vmodem.h>
+#include <asterisk/utils.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <errno.h>
@@ -673,7 +674,7 @@
 		pthread_join(monitor_thread, NULL);
 	}
 	/* Start a new monitor */
-	if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+	if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 		ast_mutex_unlock(&monlock);
 		ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 		return -1;

Index: chan_oss.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_oss.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- chan_oss.c	16 Jul 2004 04:40:54 -0000	1.29
+++ chan_oss.c	8 Aug 2004 17:15:02 -0000	1.30
@@ -25,6 +25,7 @@
 #include <asterisk/pbx.h>
 #include <asterisk/config.h>
 #include <asterisk/cli.h>
+#include <asterisk/utils.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -1011,7 +1012,7 @@
 		}
 		ast_destroy(cfg);
 	}
-	pthread_create(&sthread, NULL, sound_thread, NULL);
+	ast_pthread_create(&sthread, NULL, sound_thread, NULL);
 	return 0;
 }
 

Index: chan_phone.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_phone.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- chan_phone.c	16 Jul 2004 04:40:54 -0000	1.32
+++ chan_phone.c	8 Aug 2004 17:15:02 -0000	1.33
@@ -962,7 +962,7 @@
 #endif
 	}
 	/* Start a new monitor */
-	if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+	if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 		ast_mutex_unlock(&monlock);
 		ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 		return -1;

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.467
retrieving revision 1.468
diff -u -d -r1.467 -r1.468
--- chan_sip.c	8 Aug 2004 04:49:43 -0000	1.467
+++ chan_sip.c	8 Aug 2004 17:15:02 -0000	1.468
@@ -6780,7 +6780,7 @@
 		copy_request(&d->req, req);
 		d->chan1 = chan1m;
 		d->chan2 = chan2m;
-		if (!pthread_create(&th, NULL, sip_park_thread, d))
+		if (!ast_pthread_create(&th, NULL, sip_park_thread, d))
 			return 0;
 		free(d);
 	}
@@ -7633,7 +7633,7 @@
 		pthread_attr_init(&attr);
 		pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;

Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- chan_skinny.c	17 Jul 2004 20:58:00 -0000	1.52
+++ chan_skinny.c	8 Aug 2004 17:15:02 -0000	1.53
@@ -2113,7 +2113,7 @@
 					c = skinny_new(sub, AST_STATE_DOWN);			
 					if(c) {
 						/* start switch */
-						if (pthread_create(&t, NULL, skinny_ss, c)) {
+						if (ast_pthread_create(&t, NULL, skinny_ss, c)) {
 							ast_log(LOG_WARNING, "Unable to create switch thread: %s\n", strerror(errno));
 							ast_hangup(c);
 						}
@@ -2403,7 +2403,7 @@
 		sessions = s;
 		ast_mutex_unlock(&sessionlock);
 		
-		if (pthread_create(&tcp_thread, NULL, skinny_session, s)) {
+		if (ast_pthread_create(&tcp_thread, NULL, skinny_session, s)) {
 			destroy_session(s);
 		}
 	}
@@ -2461,7 +2461,7 @@
 		pthread_kill(monitor_thread, SIGURG);
 	} else {
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;
@@ -2649,7 +2649,7 @@
 				ast_verbose(VERBOSE_PREFIX_2 "Skinny listening on %s:%d\n", 
 					ast_inet_ntoa(iabuf, sizeof(iabuf), bindaddr.sin_addr), ntohs(bindaddr.sin_port));
 
-			pthread_create(&accept_t,NULL, accept_thread, NULL);
+			ast_pthread_create(&accept_t,NULL, accept_thread, NULL);
 		}
 	}
 	ast_mutex_unlock(&netlock);

Index: chan_vofr.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vofr.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- chan_vofr.c	16 Jul 2004 04:40:54 -0000	1.18
+++ chan_vofr.c	8 Aug 2004 17:15:02 -0000	1.19
@@ -19,6 +19,7 @@
 #include <asterisk/config.h>
 #include <asterisk/logger.h>
 #include <asterisk/module.h>
+#include <asterisk/utils.h>
 #include <asterisk/pbx.h>
 #include <asterisk/options.h>
 #include <sys/socket.h>
@@ -1014,7 +1015,7 @@
 		pthread_kill(monitor_thread, SIGURG);
 	} else {
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;

Index: chan_vpb.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -d -r1.32 -r1.33
--- chan_vpb.c	16 Jul 2004 04:40:54 -0000	1.32
+++ chan_vpb.c	8 Aug 2004 17:15:02 -0000	1.33
@@ -23,6 +23,7 @@
 #include <asterisk/module.h>
 #include <asterisk/pbx.h>
 #include <asterisk/options.h>
+#include <asterisk/utils.h>
 #include <sys/socket.h>
 #include <sys/time.h>
 #include <errno.h>
@@ -942,7 +943,7 @@
 			vpb_put_event(&e);
 		} else {
 			/* Start a new monitor */
-			int pid = pthread_create(&monitor_thread, NULL, do_monitor, NULL); 
+			int pid = ast_pthread_create(&monitor_thread, NULL, do_monitor, NULL); 
 			if (option_verbose > 3)
 				ast_verbose(VERBOSE_PREFIX_4 "Created new monitor thread %d\n",pid);
 			if (pid < 0) {
@@ -1287,7 +1288,7 @@
 	}
 
 	if (!p->readthread){
-		pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
+		ast_pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
 	}
 
 	tmp = ast_mutex_unlock(&p->lock);
@@ -1423,7 +1424,7 @@
 		if( !p->readthread ){
 	//		res = ast_mutex_unlock(&p->lock);
 	//		ast_verbose("%s: unLOCKING in answer [%d]\n", p->dev,res);
-			pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
+			ast_pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
 		} else {
 			if(option_verbose>3) 
 				ast_verbose(VERBOSE_PREFIX_4 "%s: Record thread already running!!\n",p->dev);

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.320
retrieving revision 1.321
diff -u -d -r1.320 -r1.321
--- chan_zap.c	7 Aug 2004 19:27:54 -0000	1.320
+++ chan_zap.c	8 Aug 2004 17:15:02 -0000	1.321
@@ -3482,7 +3482,7 @@
 									if (res)
 										ast_log(LOG_WARNING, "Unable to start dial recall tone on channel %d\n", p->channel);
 									p->owner = chan;
-									if (chan && pthread_create(&threadid, &attr, ss_thread, chan)) {
+									if (chan && ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
 										ast_log(LOG_WARNING, "Unable to start simple switch on channel %d\n", p->channel);
 										res = tone_zone_play_tone(p->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
 										zt_enable_ec(p);
@@ -5311,7 +5311,7 @@
 						res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_DIALTONE);
 					if (res < 0) 
 						ast_log(LOG_WARNING, "Unable to play dialtone on channel %d\n", i->channel);
-					if (pthread_create(&threadid, &attr, ss_thread, chan)) {
+					if (ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
 						ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
 						res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
 						if (res < 0)
@@ -5344,7 +5344,7 @@
 		case SIG_SF:
 				/* Check for callerid, digits, etc */
 				chan = zt_new(i, AST_STATE_RING, 0, SUB_REAL, 0, 0);
-				if (chan && pthread_create(&threadid, &attr, ss_thread, chan)) {
+				if (chan && ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
 					ast_log(LOG_WARNING, "Unable to start simple switch thread on channel %d\n", i->channel);
 					res = tone_zone_play_tone(i->subs[SUB_REAL].zfd, ZT_TONE_CONGESTION);
 					if (res < 0)
@@ -5670,7 +5670,7 @@
 #endif
 	} else {
 		/* Start a new monitor */
-		if (pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
+		if (ast_pthread_create(&monitor_thread, &attr, do_monitor, NULL) < 0) {
 			ast_mutex_unlock(&monlock);
 			ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
 			return -1;
@@ -6951,7 +6951,7 @@
 					idle = zt_request("Zap", AST_FORMAT_ULAW, idlen);
 					if (idle) {
 						pri->pvts[nextidle]->isidlecall = 1;
-						if (pthread_create(&p, NULL, do_idle_thread, idle)) {
+						if (ast_pthread_create(&p, NULL, do_idle_thread, idle)) {
 							ast_log(LOG_WARNING, "Unable to start new thread for idle channel '%s'\n", idle->name);
 							zt_hangup(idle);
 						}
@@ -7320,7 +7320,7 @@
 								pbx_builtin_setvar_helper(c, "CALLINGSUBADDR", e->ring.callingsubaddr);
 							}
 							ast_mutex_lock(&pri->lock);
-							if (c && !pthread_create(&threadid, &attr, ss_thread, c)) {
+							if (c && !ast_pthread_create(&threadid, &attr, ss_thread, c)) {
 								if (option_verbose > 2)
 									ast_verbose(VERBOSE_PREFIX_3 "Accepting overlap call from '%s' to '%s' on channel %d/%d, span %d\n",
 										e->ring.callingnum, !ast_strlen_zero(pri->pvts[chanpos]->exten) ? pri->pvts[chanpos]->exten : "<unspecified>", 
@@ -7777,7 +7777,7 @@
 	/* Assume primary is the one we use */
 	pri->pri = pri->dchans[0];
 	pri->resetpos = -1;
-	if (pthread_create(&pri->master, NULL, pri_dchannel, pri)) {
+	if (ast_pthread_create(&pri->master, NULL, pri_dchannel, pri)) {
 		for (i=0;i<NUM_DCHANS;i++) {
 			if (!pri->dchannels[i])
 				break;




More information about the svn-commits mailing list