[Asterisk-code-review] chan sip.c: Made sip reinvite retry() call sip pvt lock full(). (asterisk[11])
Richard Mudgett
asteriskteam at digium.com
Mon Mar 14 14:00:22 CDT 2016
Richard Mudgett has uploaded a new change for review.
https://gerrit.asterisk.org/2386
Change subject: chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().
......................................................................
chan_sip.c: Made sip_reinvite_retry() call sip_pvt_lock_full().
Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
---
M channels/chan_sip.c
1 file changed, 2 insertions(+), 6 deletions(-)
git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/86/2386/1
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index b7e4c69..d6a4bb3 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -22649,18 +22649,14 @@
struct sip_pvt *p = (struct sip_pvt *) data;
struct ast_channel *owner;
- sip_pvt_lock(p); /* called from schedule thread which requires a lock */
- while ((owner = p->owner) && ast_channel_trylock(owner)) {
- sip_pvt_unlock(p);
- usleep(1);
- sip_pvt_lock(p);
- }
+ owner = sip_pvt_lock_full(p);
ast_set_flag(&p->flags[0], SIP_NEEDREINVITE);
p->waitid = -1;
check_pendings(p);
sip_pvt_unlock(p);
if (owner) {
ast_channel_unlock(owner);
+ ast_channel_unref(owner);
}
dialog_unref(p, "unref the dialog ptr from sip_reinvite_retry, because it held a dialog ptr");
return 0;
--
To view, visit https://gerrit.asterisk.org/2386
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I90f04208a089f95488a2460185a8dbc3f6acca12
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 11
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
More information about the asterisk-code-review
mailing list