aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-08 17:15:02 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-08-08 17:15:02 +0000
commit28a366ed7268db8428ee2d78fb44f29c78067dd9 (patch)
treee2443cc3c4c3b09b706e611a61f475c509778c57 /channels
parentd85f0f5c24a90dab01664373615a8e243e6f5851 (diff)
Merge BSD stack size work (bug #2067)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3596 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_alsa.c3
-rwxr-xr-xchannels/chan_h323.c2
-rwxr-xr-xchannels/chan_iax.c2
-rwxr-xr-xchannels/chan_iax2.c6
-rwxr-xr-xchannels/chan_mgcp.c4
-rwxr-xr-xchannels/chan_modem.c3
-rwxr-xr-xchannels/chan_oss.c3
-rwxr-xr-xchannels/chan_phone.c2
-rwxr-xr-xchannels/chan_sip.c4
-rwxr-xr-xchannels/chan_skinny.c8
-rwxr-xr-xchannels/chan_vofr.c3
-rwxr-xr-xchannels/chan_vpb.c7
-rwxr-xr-xchannels/chan_zap.c14
13 files changed, 33 insertions, 28 deletions
diff --git a/channels/chan_alsa.c b/channels/chan_alsa.c
index 5f0efdde9..be1f09700 100755
--- a/channels/chan_alsa.c
+++ b/channels/chan_alsa.c
@@ -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 @@ int load_module()
}
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");
diff --git a/channels/chan_h323.c b/channels/chan_h323.c
index 9bd35f0ea..124c2d999 100755
--- a/channels/chan_h323.c
+++ b/channels/chan_h323.c
@@ -1441,7 +1441,7 @@ static int restart_monitor(void)
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;
diff --git a/channels/chan_iax.c b/channels/chan_iax.c
index 754ce2509..6a3cc34e2 100755
--- a/channels/chan_iax.c
+++ b/channels/chan_iax.c
@@ -4548,7 +4548,7 @@ static void *network_thread(void *ignore)
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)
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index f135f15eb..4c5191528 100755
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -4729,7 +4729,7 @@ static void spawn_dp_lookup(int callno, char *context, char *callednum, char *ca
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 @@ static int iax_park(struct ast_channel *chan1, struct ast_channel *chan2)
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 void *network_thread(void *ignore)
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)
diff --git a/channels/chan_mgcp.c b/channels/chan_mgcp.c
index 205550b94..0ea32abf9 100755
--- a/channels/chan_mgcp.c
+++ b/channels/chan_mgcp.c
@@ -2798,7 +2798,7 @@ static void handle_hd_hf(struct mgcp_subchannel *sub, char *ev)
}
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 @@ static int restart_monitor(void)
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;
diff --git a/channels/chan_modem.c b/channels/chan_modem.c
index 1a235c4f5..6113e0844 100755
--- a/channels/chan_modem.c
+++ b/channels/chan_modem.c
@@ -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 @@ static int restart_monitor()
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;
diff --git a/channels/chan_oss.c b/channels/chan_oss.c
index 538bfe1f8..86370f971 100755
--- a/channels/chan_oss.c
+++ b/channels/chan_oss.c
@@ -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 @@ int load_module()
}
ast_destroy(cfg);
}
- pthread_create(&sthread, NULL, sound_thread, NULL);
+ ast_pthread_create(&sthread, NULL, sound_thread, NULL);
return 0;
}
diff --git a/channels/chan_phone.c b/channels/chan_phone.c
index 4828d05ef..bacfaa3c4 100755
--- a/channels/chan_phone.c
+++ b/channels/chan_phone.c
@@ -962,7 +962,7 @@ static int restart_monitor()
#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;
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 28954cd05..614f3a964 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -6780,7 +6780,7 @@ static int sip_park(struct ast_channel *chan1, struct ast_channel *chan2, struct
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 @@ static int restart_monitor(void)
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;
diff --git a/channels/chan_skinny.c b/channels/chan_skinny.c
index df3398dd0..db8a1ae82 100755
--- a/channels/chan_skinny.c
+++ b/channels/chan_skinny.c
@@ -2113,7 +2113,7 @@ static int handle_message(skinny_req *req, struct skinnysession *s)
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 @@ static void *accept_thread(void *ignore)
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 @@ static int restart_monitor(void)
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 @@ static int reload_config(void)
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);
diff --git a/channels/chan_vofr.c b/channels/chan_vofr.c
index ad567aff4..eefde380d 100755
--- a/channels/chan_vofr.c
+++ b/channels/chan_vofr.c
@@ -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 @@ static int restart_monitor(void)
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;
diff --git a/channels/chan_vpb.c b/channels/chan_vpb.c
index e07b1c7d5..01d95a86b 100755
--- a/channels/chan_vpb.c
+++ b/channels/chan_vpb.c
@@ -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 @@ static int restart_monitor(void)
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 @@ static int vpb_call(struct ast_channel *ast, char *dest, int timeout)
}
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 @@ static int vpb_answer(struct ast_channel *ast)
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);
diff --git a/channels/chan_zap.c b/channels/chan_zap.c
index e97620ed0..8a3b45380 100755
--- a/channels/chan_zap.c
+++ b/channels/chan_zap.c
@@ -3482,7 +3482,7 @@ static struct ast_frame *zt_handle_event(struct ast_channel *ast)
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 @@ static int handle_init_event(struct zt_pvt *i, int event)
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 @@ static int handle_init_event(struct zt_pvt *i, int event)
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 @@ static int restart_monitor(void)
#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 @@ static void *pri_dchannel(void *vpri)
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 @@ static void *pri_dchannel(void *vpri)
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 @@ static int start_pri(struct zt_pri *pri)
/* 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;