diff options
author | BJ Weschke <bweschke@btwtech.com> | 2006-10-27 19:28:34 +0000 |
---|---|---|
committer | BJ Weschke <bweschke@btwtech.com> | 2006-10-27 19:28:34 +0000 |
commit | eea3a260dafc20addf7d08a7defe154aed539c54 (patch) | |
tree | 6f6cb0bcc6fd6012c34ca16038d2135bdc0e0104 /apps/app_queue.c | |
parent | 955f1ef0fe65d9b9ef5a498d37c72ae8112df72c (diff) |
Let's make sure we hold the mutex lock before we go looking at values in the queue structure that could potentially be changing while we're running.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r-- | apps/app_queue.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c index a20f6893c..fa366fb5f 100644 --- a/apps/app_queue.c +++ b/apps/app_queue.c @@ -1842,8 +1842,8 @@ static int say_periodic_announcement(struct queue_ent *qe) static void record_abandoned(struct queue_ent *qe) { - set_queue_variables(qe); ast_mutex_lock(&qe->parent->lock); + set_queue_variables(qe); manager_event(EVENT_FLAG_AGENT, "QueueCallerAbandon", "Queue: %s\r\n" "Uniqueid: %s\r\n" @@ -2615,6 +2615,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce ast_channel_sendurl(peer, url); } + ast_mutex_lock(&qe->parent->lock); /* if setinterfacevar is defined, make member variables available to the channel */ /* use pbx_builtin_setvar to set a load of variables with one call */ if (qe->parent->setinterfacevar) { @@ -2633,6 +2634,7 @@ static int try_calling(struct queue_ent *qe, const char *options, char *announce /* try to set queue variables if configured to do so*/ set_queue_variables(qe); + ast_mutex_unlock(&qe->parent->lock); /* run a macro for this connection if defined. The macro simply returns, no action is taken on the result */ /* use macro from dialplan if passed as a option, otherwise use the default queue macro */ |