[Asterisk-code-review] chan sip: Prevent deadlock when issuing "sip show channels" (asterisk[11])

Richard Mudgett asteriskteam at digium.com
Thu Jul 21 14:28:21 CDT 2016


Richard Mudgett has posted comments on this change.

Change subject: chan_sip: Prevent deadlock when issuing "sip show channels"
......................................................................


Patch Set 3:

(1 comment)

https://gerrit.asterisk.org/#/c/3273/3/channels/chan_sip.c
File channels/chan_sip.c:

Line 20738: 	for (; (cur = ao2_iterator_next(&i)); ao2_ref(cur, -1)) {
> Nit: would you mind switching this to a while loop?
It can be done either way.  However, if the loop body is complicated then thinking of the unref as an increment allows the use of the continue statement without having to place unrefs everywhere.  You could say it is almost RAII_VAR like.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9980419909e811f89484950ed46ef117b9eb990
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list