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

Richard Mudgett asteriskteam at digium.com
Fri Apr 24 11:44:49 CDT 2015


Richard Mudgett has posted comments on this change.

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


Patch Set 5:

(9 comments)

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

Line 1684: static int iax_try_lock_unless_hungup(int callno){
Guideline: Function curly on its own line.
void foo()
{
}


Line 1685: 	while (ast_mutex_trylock(&iaxsl[callno]) != 0){
Add missing space: ) {


Line 1687: 		if(!iaxs[callno] || (iaxs[callno] && iaxs[callno]->destroy_initiated)) {
Add missing space: if (


Line 1691: 		ast_debug(3,"Waiting for the callno %d hangup to finish\n", callno);
This debug message will spam and should be removed.


Line 1692: 		usleep(100);
Instead of a dead wait use:
sched_yield();


Line 1708:     /* callno is now locked. */
This line is using spaces to indent when you need to use tabs.


Line 1769:     /* callno is now locked. */
same here


Line 2087: 	/* Remove scheduled (but didn't run yet) PINGs or LAGRQs */
         : 	/* Already running tasks will be terminated because of destroy_initiated. */
This should be one comment block.

/*
 * blah
 * blah
 */


https://gerrit.asterisk.org/#/c/169/5/main/sched.c
File main/sched.c:

Line 507: 			ast_log(LOG_WARNING, "Waiting for sched task %d to finish to delete it.\n", id);
This will spam the log even under normal use and by different scheduled items.  Please revert the changes to this file.


-- 
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: 5
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Y Ateya <y.ateya at starkbits.com>
Gerrit-Reviewer: George Joseph <george.joseph at fairview5.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