Merged revisions 118953 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r118953 | tilghman | 2008-05-29 12:20:16 -0500 (Thu, 29 May 2008) | 3 lines

Add some debugging code that ensures that when we do deadlock avoidance, we
don't lose the information about how a lock was originally acquired.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@118955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2008-05-29 17:35:19 +00:00
parent 9a535bd115
commit 6e5d843a71
7 changed files with 78 additions and 53 deletions

View File

@@ -1520,9 +1520,7 @@ static int agent_logoff(const char *agent, int soft)
ast_mutex_lock(&p->lock);
while (p->owner && ast_channel_trylock(p->owner)) {
ast_mutex_unlock(&p->lock);
usleep(1);
ast_mutex_lock(&p->lock);
DEADLOCK_AVOIDANCE(&p->lock);
}
if (p->owner) {
ast_softhangup(p->owner, AST_SOFTHANGUP_EXPLICIT);
@@ -1530,9 +1528,7 @@ static int agent_logoff(const char *agent, int soft)
}
while (p->chan && ast_channel_trylock(p->chan)) {
ast_mutex_unlock(&p->lock);
usleep(1);
ast_mutex_lock(&p->lock);
DEADLOCK_AVOIDANCE(&p->lock);
}
if (p->chan) {
ast_softhangup(p->chan, AST_SOFTHANGUP_EXPLICIT);