[asterisk-commits] irroot: branch irroot/distrotech-customers-trunk r335788 - /team/irroot/distr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Sep 14 06:13:53 CDT 2011


Author: irroot
Date: Wed Sep 14 06:13:50 2011
New Revision: 335788

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=335788
Log:
Add back the lock for config reload in app_queues RB1402 ASTERISK-18101

Modified:
    team/irroot/distrotech-customers-trunk/apps/app_queue.c

Modified: team/irroot/distrotech-customers-trunk/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/distrotech-customers-trunk/apps/app_queue.c?view=diff&rev=335788&r1=335787&r2=335788
==============================================================================
--- team/irroot/distrotech-customers-trunk/apps/app_queue.c (original)
+++ team/irroot/distrotech-customers-trunk/apps/app_queue.c Wed Sep 14 06:13:50 2011
@@ -6996,11 +6996,14 @@
 		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*/
 	if (queue_reload) {
-		ao2_callback(queues, OBJ_NODATA, mark_dead_and_unfound, (char *) queuename);
+		ao2_callback(queues, OBJ_NODATA | OBJ_NOLOCK, mark_dead_and_unfound, (char *) queuename);
 	}
 
 	/* Chug through config file */
@@ -7017,8 +7020,9 @@
 	ast_config_destroy(cfg);
 	/* Unref all the dead queues if we were reloading queues */
 	if (queue_reload) {
-		ao2_callback(queues, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK, kill_dead_queues, (char *) queuename);
-	}
+		ao2_callback(queues, OBJ_NODATA | OBJ_MULTIPLE | OBJ_UNLINK | OBJ_NOLOCK, kill_dead_queues, (char *) queuename);
+	}
+	ao2_unlock(queues);
 	return 0;
 }
 
@@ -7026,7 +7030,7 @@
  *
  * This function actually does not reset any statistics, but
  * rather finds a call_queue struct which corresponds to the
- * passed-in queue name and passes that structure to the 
+ * passed-in queue name and passes that structure to the
  * clear_queue function. If no queuename is passed in, then
  * all queues will have their statistics reset.
  *




More information about the asterisk-commits mailing list