[asterisk-commits] irroot: branch irroot/asterisk-trunk-quack-queue r342986 - /team/irroot/aster...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 2 05:26:50 CDT 2011


Author: irroot
Date: Wed Nov  2 05:26:46 2011
New Revision: 342986

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=342986
Log:
Locking on update_status without memcpy

Modified:
    team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c

Modified: team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c
URL: http://svnview.digium.com/svn/asterisk/team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c?view=diff&rev=342986&r1=342985&r2=342986
==============================================================================
--- team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c (original)
+++ team/irroot/asterisk-trunk-quack-queue/apps/app_queue.c Wed Nov  2 05:26:46 2011
@@ -1463,11 +1463,12 @@
 		miter = ao2_iterator_init(q->members, 0);
 		while((m = ao2_iterator_next(&miter))) {
 			ao2_lock(m);
-			if (strcasecmp(m->device->state_interface, s->state_interface)) {
+			if (m->device != s) {
 				ao2_unlock(m);
 				ao2_ref(m, -1);
 				continue;
 			}
+			ao2_lock(s);
 			manager_event(EVENT_FLAG_AGENT, "QueueMemberStatus",
 				"Queue: %s\r\n"
 				"Location: %s\r\n"
@@ -1482,6 +1483,7 @@
 				q->name, m->interface, m->membername, s->state_interface, m->dynamic ? "dynamic" : m->realtime ? "realtime" : "static",
 				m->penalty, m->calls, (int)m->lastcall, s->status, m->paused
 			);
+			ao2_unlock(s);
 			ao2_unlock(m);
 			ao2_ref(m, -1);
 		}




More information about the asterisk-commits mailing list