[asterisk-commits] jpeeler: branch jpeeler/bug13173 r150727 - /team/jpeeler/bug13173/apps/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Oct 17 14:10:52 CDT 2008
Author: jpeeler
Date: Fri Oct 17 14:10:52 2008
New Revision: 150727
URL: http://svn.digium.com/view/asterisk?view=rev&rev=150727
Log:
Make the announcelist by conference instead of global.
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=150727&r1=150726&r2=150727
==============================================================================
--- team/jpeeler/bug13173/apps/app_meetme.c (original)
+++ team/jpeeler/bug13173/apps/app_meetme.c Fri Oct 17 14:10:52 2008
@@ -316,6 +316,14 @@
#define MAX_CONFNUM 80
#define MAX_PIN 80
+struct announce_listitem {
+ AST_LIST_ENTRY(announce_listitem) list;
+ char namerecloc[PATH_MAX]; /*!< Name Recorded file Location */
+ char language[MAX_LANGUAGE];
+ struct ast_channel *confchan;
+ int confusers;
+};
+
/*! \brief The MeetMe Conference object */
struct ast_conference {
ast_mutex_t playlock; /*!< Conference specific lock (players) */
@@ -346,20 +354,11 @@
struct ast_trans_pvt *transpath[32];
AST_LIST_HEAD_NOLOCK(, ast_conf_user) userlist;
AST_LIST_ENTRY(ast_conference) list;
+ ast_cond_t announcelist_addition;
+ AST_LIST_HEAD(, announce_listitem) announcelist;
};
static AST_LIST_HEAD_STATIC(confs, ast_conference);
-
-struct announce_listitem {
- AST_LIST_ENTRY(announce_listitem) list;
- char namerecloc[PATH_MAX]; /*!< Name Recorded file Location */
- char language[MAX_LANGUAGE];
- struct ast_channel *confchan;
- int confusers;
-};
-
-static AST_LIST_HEAD_STATIC(announcelist, announce_listitem);
-static ast_cond_t announcelist_addition;
static unsigned int conf_map[1024] = {0, };
@@ -1282,8 +1281,9 @@
ast_mutex_destroy(&conf->listenlock);
ast_mutex_destroy(&conf->recordthreadlock);
ast_mutex_destroy(&conf->announcethreadlock);
- if (conf->announcethread != AST_PTHREADT_NULL)
+ if (conf->announcethread != AST_PTHREADT_NULL) {
pthread_cancel(conf->announcethread);
+ }
free(conf);
return 0;
@@ -1390,16 +1390,16 @@
static void *announce_thread(void *data)
{
-
struct announce_listitem *next, *current;
+ struct ast_conference *conf = (struct ast_conference *) data;
for (;;) {
- AST_LIST_LOCK(&announcelist);
- if (AST_LIST_EMPTY(&announcelist))
- ast_cond_wait(&announcelist_addition, &announcelist.lock);
- next = AST_LIST_FIRST(&announcelist);
- AST_LIST_HEAD_INIT_NOLOCK(&announcelist);
- AST_LIST_UNLOCK(&announcelist);
+ AST_LIST_LOCK(&conf->announcelist);
+ if (AST_LIST_EMPTY(&conf->announcelist))
+ ast_cond_wait(&conf->announcelist_addition, &conf->announcelist.lock);
+ next = AST_LIST_FIRST(&conf->announcelist);
+ AST_LIST_HEAD_INIT_NOLOCK(&conf->announcelist);
+ AST_LIST_UNLOCK(&conf->announcelist);
while ((current = next)) {
next = AST_LIST_NEXT(current, list);
@@ -2328,10 +2328,10 @@
ast_copy_string(item->language, chan->language, sizeof(item->language));
item->confchan = conf->chan;
item->confusers = conf->users;
- AST_LIST_LOCK(&announcelist);
- AST_LIST_INSERT_TAIL(&announcelist, item, list);
- ast_cond_signal(&announcelist_addition);
- AST_LIST_UNLOCK(&announcelist);
+ AST_LIST_LOCK(&conf->announcelist);
+ AST_LIST_INSERT_TAIL(&conf->announcelist, item, list);
+ ast_cond_signal(&conf->announcelist_addition);
+ AST_LIST_UNLOCK(&conf->announcelist);
}
AST_LIST_UNLOCK(&confs);
More information about the asterisk-commits
mailing list