[Asterisk-code-review] chan iax2: Prevent deadlock between hangup and sending lagrq... (asterisk[master])

Richard Mudgett asteriskteam at digium.com
Thu May 14 13:16:38 CDT 2015


Richard Mudgett has posted comments on this change.

Change subject: chan_iax2: Prevent deadlock between hangup and sending lagrq/ping
......................................................................


Patch Set 11: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/169/11/channels/chan_iax2.c
File channels/chan_iax2.c:

Line 1706: 	/* Mark pingid as invalid scheduler id. */
         : 	iaxs[callno]->pingid = -1;
You missed my point.  pingid becomes invalid when send_ping() returns.  __send_ping() and send_ping() are normally executed by different threads.  send_ping() executes in the scheduler context thread.   __send_ping() normally executes in an idle iax2 thread selected by schedule_action() in send_ping() because SCHED_MULTITHREADED is defined.  This is why send_ping() must set pingid to -1.

This is the same for send_lagrq().

int callno = PTR_TO_CALLNO(data);

ast_mutex_lock(&iaxsl[callno]);
if (iaxs[callno]) {
  iaxs[callno]->pingid = -1;
}
ast_mutex_unlock(&iaxsl[callno]);


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I03bec1fc8faacb89630269e935fa667c6d6c080c
Gerrit-PatchSet: 11
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: Ashley Sanders <asanders at digium.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Matt Jordan <mjordan at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Y Ateya <y.ateya at starkbits.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list