[Asterisk-code-review] app queue: queue members can receive multiple calls (asterisk[13])

George Joseph asteriskteam at digium.com
Thu Apr 21 15:49:51 CDT 2016


George Joseph has posted comments on this change.

Change subject: app_queue: queue members can receive multiple calls
......................................................................


Patch Set 1:

(1 comment)

https://gerrit.asterisk.org/#/c/2677/1/apps/app_queue.c
File apps/app_queue.c:

PS1, Line 4252: 		ao2_lock(pending_members);
              : 
              : 		member = ao2_find(pending_members, call->member,
              : 				  OBJ_SEARCH_OBJECT | OBJ_NOLOCK);
              : 		if (member) {
              : 			/*
              : 			 * If found that means this member is currently being attempted
              : 			 * from another calling thread, so stop trying from this thread
              : 			 */
              : 			ast_debug(1, "%s has another call trying, can't receive call\n",
              : 				  call->interface);
              : 			ao2_ref(member, -1);
              : 			ao2_unlock(pending_members);
              : 			return 0;
              : 		}
              : 
              : 		/*
              : 		 * If not found add it to the container so another queue
              : 		 * won't attempt to call this member at the same time.
              : 		 */
              : 		ao2_link(pending_members, call->member);
              : 		ao2_unlock(pending_members);
you might want to make the container a RWLOCK, then RDLOCK for the find and only WRLOCK for the link and unlink of course.

not sure if it's worth it for this situation


-- 
To view, visit https://gerrit.asterisk.org/2677
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I546dd474776d158c2b6be44205353dee5bac7e48
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list