summaryrefslogtreecommitdiff
path: root/apps/app_queue.c
diff options
context:
space:
mode:
authorGregory Nietsky <gregory@distrotech.co.za>2011-10-24 07:40:18 +0000
committerGregory Nietsky <gregory@distrotech.co.za>2011-10-24 07:40:18 +0000
commit7ac53e57b39843f977a3f5a5f5937a55fccdef30 (patch)
tree973a28485c21ad460fe54e3f2ad3b3cd18a9e75f /apps/app_queue.c
parent3d55a05019d34eb8cc9ce5815e1248c0535cb601 (diff)
queues container needs locking when using the OBJ_NOLOCK flag
........ Merged revisions 342017 from http://svn.asterisk.org/svn/asterisk/branches/10 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'apps/app_queue.c')
-rw-r--r--apps/app_queue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/app_queue.c b/apps/app_queue.c
index ce886df7f..d3a53167f 100644
--- a/apps/app_queue.c
+++ b/apps/app_queue.c
@@ -7054,6 +7054,9 @@ static int reload_queues(int reload, struct ast_flags *mask, const char *queuena
return -1;
}
+ /* We've made it here, so it looks like we're doing operations on all queues. */
+ ao2_lock(queues);
+
/* Mark all queues as dead for the moment if we're reloading queues.
* For clarity, we could just be reloading members, in which case we don't want to mess
* with the other queue parameters at all*/
@@ -7077,6 +7080,7 @@ static int reload_queues(int reload, struct ast_flags *mask, const char *queuena
if (queue_reload) {
ao2_callback(queues, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK | OBJ_NOLOCK, kill_dead_queues, (char *) queuename);
}
+ ao2_unlock(queues);
return 0;
}