summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2003-09-17 20:51:53 +0000
committerMark Spencer <markster@digium.com>2003-09-17 20:51:53 +0000
commit90f6d836eea21b18bc7d8fcedc24a9320bef9cf6 (patch)
tree5ccc6078f97dbd6e3c3f49a622c6a431cca43fa6 /channels
parent233591ddc5feda96cdb9fb254e60d8b4cb08b74b (diff)
Fix deadlock pointed to by Martin
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1524 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c8f44579c..936fea3e1 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -5175,17 +5175,17 @@ static int sipsock_read(int *id, int fd, short events, void *ignore)
return 1;
}
/* Process request, with netlock held */
+retrylock:
ast_mutex_lock(&netlock);
p = find_call(&req, &sin);
if (p) {
-retrylock:
/* Go ahead and lock the owner if it has one -- we may need it */
if (p->owner && ast_mutex_trylock(&p->owner->lock)) {
ast_log(LOG_DEBUG, "Failed to grab lock, trying again...\n");
ast_mutex_unlock(&p->lock);
+ ast_mutex_unlock(&netlock);
/* Sleep infintismly short amount of time */
usleep(1);
- ast_mutex_lock(&p->lock);
goto retrylock;
}
memcpy(&p->recv, &sin, sizeof(p->recv));