]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
queues container needs locking when using the OBJ_NOLOCK flag
authorGregory Nietsky <gregory@distrotech.co.za>
Mon, 24 Oct 2011 07:31:10 +0000 (07:31 +0000)
committerGregory Nietsky <gregory@distrotech.co.za>
Mon, 24 Oct 2011 07:31:10 +0000 (07:31 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342017 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c

index 28889e31463f950cc822524349911e5ef806572f..2ffbc84d9664bcebea726b7e7831b4d2ded9637c 100644 (file)
@@ -6993,6 +6993,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*/
@@ -7016,6 +7019,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;
 }