Fix deadlock in iax

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Martin Pycko 2003-11-13 23:49:15 +00:00
parent f6c230ebcb
commit e7626bb3ce
1 changed files with 7 additions and 1 deletions

View File

@ -3774,7 +3774,13 @@ static int socket_read(int *id, int fd, short events, void *cbdata)
ast_log(LOG_DEBUG, "Ooh, voice format changed to %s\n", ast_getformatname(f.subclass));
if (iaxs[fr.callno]->owner) {
int orignative;
ast_mutex_lock(&iaxs[fr.callno]->owner->lock);
retryowner:
if (ast_mutex_trylock(&iaxs[fr.callno]->owner->lock)) {
ast_mutex_unlock(&iaxsl[fr.callno]);
usleep(1);
ast_mutex_lock(&iaxsl[fr.callno]);
if (iaxs[fr.callno] && iaxs[fr.callno]->owner) goto retryowner;
}
orignative = iaxs[fr.callno]->owner->nativeformats;
iaxs[fr.callno]->owner->nativeformats = f.subclass;
if (iaxs[fr.callno]->owner->readformat)