[Asterisk-code-review] astobj2: Add ao2 weakproxy find function. (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Tue Oct 10 18:10:29 CDT 2017


Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/6710 )

Change subject: astobj2: Add ao2_weakproxy_find function.
......................................................................


Patch Set 2: Code-Review-1

(5 comments)

https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c
File main/astobj2_container.c:

https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c@452
PS2, Line 452: 		orig_lock = __adjust_lock(c, AO2_LOCK_REQ_WRLOCK, 1);
Only need to request read lock level for starters.


https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c@455
PS2, Line 455: 		ao2_wrlock(c);
Only need to do ao2_rdlock() for starters.


https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c@458
PS2, Line 458: 	proxy = ao2_find(c, arg, flags | OBJ_NOLOCK);
             : 	if (proxy) {
go back to the while loop here


https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c@462
PS2, Line 462: 		if (!obj) {
             : 			ao2_unlink_flags(c, proxy, OBJ_NOLOCK);
             : 		}
if (obj) {
  ao2_ref(proxy, -1);
  break;
}

/* Upgrade to a write lock */
__adjust_lock(c, AO2_LOCK_REQ_WRLOCK);
ao2_unlink_flags(c, proxy, OBJ_NOLOCK);


https://gerrit.asterisk.org/#/c/6710/2/main/astobj2_container.c@469
PS2, Line 469: 		__adjust_lock(c, orig_lock, 0);
/* We'll keep any upgraded lock */
__adjust_lock(c, orig_lock, 1);



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

Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9da822049747275f5961b5c0a7f14e87157d65d8
Gerrit-Change-Number: 6710
Gerrit-PatchSet: 2
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Comment-Date: Tue, 10 Oct 2017 23:10:29 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20171010/3b144c53/attachment-0001.html>


More information about the asterisk-code-review mailing list