[asterisk-commits] russell: trunk r53047 - in /trunk: ./ apps/
channels/ main/ pbx/
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Wed Jan 31 14:35:16 MST 2007
Author: russell
Date: Wed Jan 31 15:35:15 2007
New Revision: 53047
URL: http://svn.digium.com/view/asterisk?view=rev&rev=53047
Log:
Merged revisions 53046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
................
r53046 | russell | 2007-01-31 15:32:08 -0600 (Wed, 31 Jan 2007) | 11 lines
Merged revisions 53045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2
........
r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines
Fix a bunch of places where pthread_attr_init() was called, but
pthread_attr_destroy() was not.
........
................
Modified:
trunk/ (props changed)
trunk/apps/app_meetme.c
trunk/apps/app_queue.c
trunk/apps/app_rpt.c
trunk/channels/chan_h323.c
trunk/channels/chan_iax2.c
trunk/channels/chan_mgcp.c
trunk/channels/chan_sip.c
trunk/channels/chan_skinny.c
trunk/channels/chan_zap.c
trunk/main/cdr.c
trunk/main/http.c
trunk/main/manager.c
trunk/main/pbx.c
trunk/pbx/pbx_dundi.c
trunk/pbx/pbx_spool.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Modified: trunk/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_meetme.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/apps/app_meetme.c (original)
+++ trunk/apps/app_meetme.c Wed Jan 31 15:35:15 2007
@@ -1081,6 +1081,7 @@
pthread_attr_init(&conf->attr);
pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create_background(&conf->recordthread, &conf->attr, recordthread, conf);
+ pthread_attr_destroy(&conf->attr);
}
time(&user->jointime);
Modified: trunk/apps/app_queue.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_queue.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/apps/app_queue.c (original)
+++ trunk/apps/app_queue.c Wed Jan 31 15:35:15 2007
@@ -631,6 +631,7 @@
ast_log(LOG_WARNING, "Failed to create update thread!\n");
free(sc);
}
+ pthread_attr_destroy(&attr);
return 0;
}
Modified: trunk/apps/app_rpt.c
URL: http://svn.digium.com/view/asterisk/trunk/apps/app_rpt.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/apps/app_rpt.c (original)
+++ trunk/apps/app_rpt.c Wed Jan 31 15:35:15 2007
@@ -3188,6 +3188,7 @@
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&myrpt->rpt_call_thread, &attr, rpt_call, (void *) myrpt);
pthread_attr_destroy(&attr);
+ pthread_attr_destroy(&attr);
return DC_COMPLETE;
}
@@ -5540,6 +5541,7 @@
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&myrpt->rpt_call_thread, &attr, rpt_call, (void *)myrpt);
+ pthread_attr_destroy(&attr);
pthread_attr_destroy(&attr);
return;
}
@@ -6736,6 +6738,7 @@
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&rpt_vars[i].rpt_thread, &attr, rpt, (void *) &rpt_vars[i]);
pthread_attr_destroy(&attr);
+ pthread_attr_destroy(&attr);
}
usleep(500000);
for (;;) {
@@ -6764,6 +6767,7 @@
pthread_attr_init(&attr);
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
ast_pthread_create(&rpt_vars[i].rpt_thread, &attr, rpt, (void *) &rpt_vars[i]);
+ pthread_attr_destroy(&attr);
pthread_attr_destroy(&attr);
ast_log(LOG_WARNING, "rpt_thread restarted on node %s\n", rpt_vars[i].name);
}
Modified: trunk/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_h323.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_h323.c (original)
+++ trunk/channels/chan_h323.c Wed Jan 31 15:35:15 2007
@@ -2610,8 +2610,10 @@
monitor_thread = AST_PTHREADT_NULL;
ast_mutex_unlock(&monlock);
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
+ pthread_attr_destroy(&attr);
return -1;
}
+ pthread_attr_destroy(&attr);
}
ast_mutex_unlock(&monlock);
return 0;
Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Wed Jan 31 15:35:15 2007
@@ -6163,6 +6163,8 @@
if (ast_pthread_create(&newthread, &attr, dp_lookup_thread, dpr)) {
ast_log(LOG_WARNING, "Unable to start lookup thread!\n");
}
+
+ pthread_attr_destroy(&attr);
}
struct iax_dual {
@@ -6237,8 +6239,11 @@
d->chan1 = chan1m;
d->chan2 = chan2m;
- if (!ast_pthread_create_background(&th, &attr, iax_park_thread, d))
+ if (!ast_pthread_create_background(&th, &attr, iax_park_thread, d)) {
+ pthread_attr_destroy(&attr);
return 0;
+ }
+ pthread_attr_destroy(&attr);
free(d);
}
return -1;
Modified: trunk/channels/chan_mgcp.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_mgcp.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_mgcp.c (original)
+++ trunk/channels/chan_mgcp.c Wed Jan 31 15:35:15 2007
@@ -3007,6 +3007,7 @@
/*ast_queue_control(sub->owner, AST_CONTROL_ANSWER);*/
}
}
+ pthread_attr_destroy(&attr);
}
static int handle_request(struct mgcp_subchannel *sub, struct mgcp_request *req, struct sockaddr_in *sin)
Modified: trunk/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_sip.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_sip.c (original)
+++ trunk/channels/chan_sip.c Wed Jan 31 15:35:15 2007
@@ -12841,8 +12841,10 @@
/* Could not start thread */
free(d); /* We don't need it anymore. If thread is created, d will be free'd
by sip_park_thread() */
+ pthread_attr_destroy(&attr);
return 0;
}
+ pthread_attr_destroy(&attr);
}
return -1;
}
Modified: trunk/channels/chan_skinny.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_skinny.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_skinny.c (original)
+++ trunk/channels/chan_skinny.c Wed Jan 31 15:35:15 2007
@@ -4307,6 +4307,7 @@
if (skinnydebug)
ast_verbose("killing accept thread\n");
close(as);
+ pthread_attr_destroy(&attr);
return 0;
}
Modified: trunk/channels/chan_zap.c
URL: http://svn.digium.com/view/asterisk/trunk/channels/chan_zap.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/channels/chan_zap.c (original)
+++ trunk/channels/chan_zap.c Wed Jan 31 15:35:15 2007
@@ -3836,9 +3836,6 @@
pthread_t threadid;
pthread_attr_t attr;
struct ast_channel *chan;
-
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
index = zt_get_index(ast, p, 0);
mysig = p->sig;
@@ -4438,6 +4435,8 @@
if (res)
ast_log(LOG_WARNING, "Unable to start dial recall tone on channel %d\n", p->channel);
p->owner = chan;
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (!chan) {
ast_log(LOG_WARNING, "Cannot allocate new structure on channel %d\n", p->channel);
} else if (ast_pthread_create(&threadid, &attr, ss_thread, chan)) {
@@ -4455,7 +4454,8 @@
!ast_strlen_zero(p->mohsuggest) ? strlen(p->mohsuggest) + 1 : 0);
}
p->subs[SUB_THREEWAY].needhold = 1;
- }
+ }
+ pthread_attr_destroy(&attr);
}
} else {
/* Already have a 3 way call */
@@ -7049,6 +7049,7 @@
"interface %d\n", i->channel);
}
}
+ pthread_attr_destroy(&attr);
return 0;
}
@@ -7273,10 +7274,12 @@
if (ast_pthread_create_background(&monitor_thread, &attr, do_monitor, NULL) < 0) {
ast_mutex_unlock(&monlock);
ast_log(LOG_ERROR, "Unable to start monitor thread.\n");
+ pthread_attr_destroy(&attr);
return -1;
}
}
ast_mutex_unlock(&monlock);
+ pthread_attr_destroy(&attr);
return 0;
}
@@ -9180,9 +9183,6 @@
char plancallingani[256];
char calledtonstr[10];
- pthread_attr_init(&attr);
- pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-
gettimeofday(&lastidle, NULL);
if (!ast_strlen_zero(pri->idledial) && !ast_strlen_zero(pri->idleext)) {
/* Need to do idle dialing, check to be sure though */
@@ -9674,6 +9674,8 @@
pbx_builtin_setvar_helper(c, "PRIREDIRECTREASON", redirectingreason2str(e->ring.redirectingreason));
ast_mutex_lock(&pri->lock);
+ pthread_attr_init(&attr);
+ pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
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",
@@ -9689,6 +9691,7 @@
pri->pvts[chanpos]->call = NULL;
}
}
+ pthread_attr_destroy(&attr);
} else {
ast_mutex_unlock(&pri->lock);
/* Release PRI lock while we create the channel */
Modified: trunk/main/cdr.c
URL: http://svn.digium.com/view/asterisk/trunk/main/cdr.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/main/cdr.c (original)
+++ trunk/main/cdr.c Wed Jan 31 15:35:15 2007
@@ -861,6 +861,7 @@
if (option_debug)
ast_log(LOG_DEBUG, "CDR multi-threaded batch processing begins now\n");
}
+ pthread_attr_destroy(&attr);
}
}
Modified: trunk/main/http.c
URL: http://svn.digium.com/view/asterisk/trunk/main/http.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/main/http.c (original)
+++ trunk/main/http.c Wed Jan 31 15:35:15 2007
@@ -684,6 +684,8 @@
close(ser->fd);
free(ser);
}
+
+ pthread_attr_destroy(&attr);
}
return NULL;
}
Modified: trunk/main/manager.c
URL: http://svn.digium.com/view/asterisk/trunk/main/manager.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/main/manager.c (original)
+++ trunk/main/manager.c Wed Jan 31 15:35:15 2007
@@ -1841,6 +1841,7 @@
} else {
res = 0;
}
+ pthread_attr_destroy(&attr);
}
} else if (!ast_strlen_zero(app)) {
res = ast_pbx_outgoing_app(tech, AST_FORMAT_SLINEAR, data, to, app, appdata, &reason, 1, l, n, vars, account, NULL);
Modified: trunk/main/pbx.c
URL: http://svn.digium.com/view/asterisk/trunk/main/pbx.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Wed Jan 31 15:35:15 2007
@@ -2506,8 +2506,10 @@
pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
if (ast_pthread_create(&t, &attr, pbx_thread, c)) {
ast_log(LOG_WARNING, "Failed to create new channel thread\n");
+ pthread_attr_destroy(&attr);
return AST_PBX_FAILED;
}
+ pthread_attr_destroy(&attr);
return AST_PBX_SUCCESS;
}
@@ -5015,8 +5017,10 @@
}
ast_hangup(chan);
res = -1;
+ pthread_attr_destroy(&attr);
goto outgoing_exten_cleanup;
}
+ pthread_attr_destroy(&attr);
res = 0;
}
outgoing_exten_cleanup:
@@ -5118,6 +5122,7 @@
if (locked_channel)
*locked_channel = chan;
}
+ pthread_attr_destroy(&attr);
}
}
} else {
@@ -5176,11 +5181,13 @@
ast_channel_unlock(chan);
ast_hangup(chan);
res = -1;
+ pthread_attr_destroy(&attr);
goto outgoing_app_cleanup;
} else {
if (locked_channel)
*locked_channel = chan;
}
+ pthread_attr_destroy(&attr);
res = 0;
}
outgoing_app_cleanup:
Modified: trunk/pbx/pbx_dundi.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_dundi.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/pbx/pbx_dundi.c (original)
+++ trunk/pbx/pbx_dundi.c Wed Jan 31 15:35:15 2007
@@ -790,8 +790,10 @@
memset(&ied, 0, sizeof(ied));
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_EIDRESPONSE, 0, 1, &ied);
+ pthread_attr_destroy(&attr);
return -1;
}
+ pthread_attr_destroy(&attr);
} else {
ast_log(LOG_WARNING, "Out of memory!\n");
memset(&ied, 0, sizeof(ied));
@@ -1019,8 +1021,10 @@
memset(&ied, 0, sizeof(ied));
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_PRECACHERP, 0, 1, &ied);
+ pthread_attr_destroy(&attr);
return -1;
}
+ pthread_attr_destroy(&attr);
} else {
ast_log(LOG_WARNING, "Out of memory!\n");
memset(&ied, 0, sizeof(ied));
@@ -1106,8 +1110,10 @@
memset(&ied, 0, sizeof(ied));
dundi_ie_append_cause(&ied, DUNDI_IE_CAUSE, DUNDI_CAUSE_GENERAL, "Out of threads");
dundi_send(trans, DUNDI_COMMAND_DPRESPONSE, 0, 1, &ied);
+ pthread_attr_destroy(&attr);
return -1;
}
+ pthread_attr_destroy(&attr);
} else {
ast_log(LOG_WARNING, "Out of memory!\n");
memset(&ied, 0, sizeof(ied));
Modified: trunk/pbx/pbx_spool.c
URL: http://svn.digium.com/view/asterisk/trunk/pbx/pbx_spool.c?view=diff&rev=53047&r1=53046&r2=53047
==============================================================================
--- trunk/pbx/pbx_spool.c (original)
+++ trunk/pbx/pbx_spool.c Wed Jan 31 15:35:15 2007
@@ -367,6 +367,7 @@
ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
free_outgoing(o);
}
+ pthread_attr_destroy(&attr);
}
static int scan_service(char *fn, time_t now, time_t atime)
@@ -499,6 +500,7 @@
ast_log(LOG_WARNING, "Unable to create thread :( (returned error: %d)\n", ret);
return -1;
}
+ pthread_attr_destroy(&attr);
return 0;
}
More information about the asterisk-commits
mailing list