[asterisk-commits] jpeeler: branch jpeeler/bug13173 r155009 - /team/jpeeler/bug13173/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Nov 6 13:14:49 CST 2008
Author: jpeeler
Date: Thu Nov 6 13:14:48 2008
New Revision: 155009
URL: http://svn.digium.com/view/asterisk?view=rev&rev=155009
Log:
I suppose there is no reason to init a mutex unless it is actually going to be used
Modified:
team/jpeeler/bug13173/apps/app_meetme.c
Modified: team/jpeeler/bug13173/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/jpeeler/bug13173/apps/app_meetme.c?view=diff&rev=155009&r1=155008&r2=155009
==============================================================================
--- team/jpeeler/bug13173/apps/app_meetme.c (original)
+++ team/jpeeler/bug13173/apps/app_meetme.c Thu Nov 6 13:14:48 2008
@@ -785,7 +785,6 @@
ast_mutex_init(&cnf->recordthreadlock);
cnf->announcethread = AST_PTHREADT_NULL;
ast_mutex_init(&cnf->announcethreadlock);
- ast_mutex_init(&cnf->announcelistlock);
ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
@@ -1424,7 +1423,7 @@
}
}
-/* jpeeler: I think using this function warrants use of ast_obj2 */
+/* jpeeler: I think using this function warrants use of astobj2 */
static int announcement_played(struct ast_conference *conf, struct ast_channel *chan)
{
struct announce_listitem *item;
@@ -1468,8 +1467,9 @@
ast_cond_wait(&conf->announcelist_addition, &conf->announcelistlock);
next = AST_LIST_FIRST(&conf->announcelist);
ast_mutex_unlock(&conf->announcelistlock);
- if (conf->announcethread_stop)
+ if (conf->announcethread_stop) {
return NULL;
+ }
while ((current = next)) {
ast_log(LOG_DEBUG, "About to play %s on behalf of %s\n", current->namerecloc, current->channame);
@@ -1598,6 +1598,7 @@
//pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
//ast_pthread_create_background(&conf->announcethread, &conf->attr, announce_thread, conf);
//pthread_attr_destroy(&conf->attr);
+ ast_mutex_init(&conf->announcelistlock);
ast_pthread_create_background(&conf->announcethread, NULL, announce_thread, conf);
}
ast_mutex_unlock(&conf->announcethreadlock);
More information about the asterisk-commits
mailing list