[asterisk-commits] russell: branch russell/sla_rewrite r53786 - /team/russell/sla_rewrite/apps/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Feb 9 17:22:42 MST 2007


Author: russell
Date: Fri Feb  9 18:22:41 2007
New Revision: 53786

URL: http://svn.digium.com/view/asterisk?view=rev&rev=53786
Log:
Move the locking and condition signalling to inside of the sla_queue_event()
function

Modified:
    team/russell/sla_rewrite/apps/app_meetme.c

Modified: team/russell/sla_rewrite/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/sla_rewrite/apps/app_meetme.c?view=diff&rev=53786&r1=53785&r2=53786
==============================================================================
--- team/russell/sla_rewrite/apps/app_meetme.c (original)
+++ team/russell/sla_rewrite/apps/app_meetme.c Fri Feb  9 18:22:41 2007
@@ -1132,7 +1132,10 @@
 	event->trunk_ref = trunk_ref;
 	event->station = station;
 
+	ast_mutex_lock(&sla.lock);
 	AST_LIST_INSERT_TAIL(&sla.event_q, event, entry);
+	ast_cond_signal(&sla.cond);
+	ast_mutex_unlock(&sla.lock);
 }
 
 static int conf_run(struct ast_channel *chan, struct ast_conference *conf, int confflags, char *optargs[])
@@ -1910,17 +1913,11 @@
 					switch (f->subclass) {
 					case AST_CONTROL_HOLD:
 						ast_log(LOG_DEBUG, "Got a HOLD frame!\n");
-						ast_mutex_lock(&sla.lock);
 						sla_queue_event(SLA_EVENT_HOLD, chan, conf);
-						ast_cond_signal(&sla.cond);
-						ast_mutex_unlock(&sla.lock);
 						break;
 					case AST_CONTROL_UNHOLD:
 						ast_log(LOG_DEBUG, "Got a UNHOLD frame!\n");
-						ast_mutex_lock(&sla.lock);
 						sla_queue_event(SLA_EVENT_UNHOLD, chan, conf);
-						ast_cond_signal(&sla.cond);
-						ast_mutex_unlock(&sla.lock);
 					default:
 						break;
 					}



More information about the asterisk-commits mailing list