aboutsummaryrefslogtreecommitdiffstats
path: root/channels/chan_iax2.c
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-30 18:13:07 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-10-30 18:13:07 +0000
commit7d0d7662d1e648bb19beac95a94e52536c7486c0 (patch)
treeb36b7d09971458fee1dc3258589763dc1b4d403d /channels/chan_iax2.c
parent961ed4851e33ad8ee83ceadd5910c03cfe338a44 (diff)
We need to lock the pvt structure during retransmission as another worker thread may be doing something as well.
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@46474 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/chan_iax2.c')
-rw-r--r--channels/chan_iax2.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index e2a0feddc..e51ccafc7 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -8060,11 +8060,12 @@ static void *network_thread(void *ignore)
continue;
f->sentyet++;
- /* Send a copy immediately -- errors here are ok, so don't bother locking */
+ ast_mutex_lock(&iaxsl[f->callno]);
if (iaxs[f->callno]) {
send_packet(f);
count++;
}
+ ast_mutex_unlock(&iaxsl[f->callno]);
if (f->retries < 0) {
/* This is not supposed to be retransmitted */
AST_LIST_REMOVE(&iaxq.queue, f, list);